Skip to content

Commit

Permalink
Added version guard
Browse files Browse the repository at this point in the history
  • Loading branch information
subnut committed Dec 11, 2021
1 parent 2958782 commit 82ffd4f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,10 @@ function! plug#end()

for [cmd, names] in items(lod.cmd)
execute printf(
\ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, <q-mods> ,%s)',
\ cmd, string(cmd), string(names))
\ has('patch-7.4.1898')
\ ? 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, <q-mods> ,%s)'
\ : 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)'
\ , cmd, string(cmd), string(names))
endfor

for [map, names] in items(lod.map)
Expand Down Expand Up @@ -672,11 +674,19 @@ function! s:lod_ft(pat, names)
call s:doautocmd('filetypeindent', 'FileType')
endfunction

function! s:lod_cmd(cmd, bang, l1, l2, args, mods, names)
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
call s:dobufread(a:names)
execute printf('%s %s%s%s %s', a:mods, (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
endfunction
if has('patch-7.4.1898')
function! s:lod_cmd(cmd, bang, l1, l2, args, mods, names)
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
call s:dobufread(a:names)
execute printf('%s %s%s%s %s', a:mods, (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
endfunction
else
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
call s:dobufread(a:names)
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
endfunction
endif

function! s:lod_map(map, names, with_prefix, prefix)
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
Expand Down

0 comments on commit 82ffd4f

Please sign in to comment.