diff --git a/plug.vim b/plug.vim index 7707189..71fb078 100644 --- a/plug.vim +++ b/plug.vim @@ -149,7 +149,7 @@ function! plug#end() endif elseif !exists(':'.cmd) execute printf( - \ "command! -nargs=* -bang %s call s:lod_cmd(%s, '', , %s)", + \ "command! -nargs=* -range -bang %s call s:lod_cmd(%s, '', , , , %s)", \ cmd, string(cmd), string(plug)) endif endfor @@ -206,10 +206,10 @@ function! s:lod_ft(name, plug) let s:loaded[a:name] = 1 endfunction -function! s:lod_cmd(cmd, bang, args, plug) +function! s:lod_cmd(cmd, bang, l1, l2, args, plug) execute 'delc '.a:cmd call s:lod(a:plug, ['plugin', 'ftdetect', 'after']) - execute printf("%s%s %s", a:cmd, a:bang, a:args) + execute printf("%s%s%s %s", (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) endfunction function! s:lod_map(map, plug)