Просмотр исходного кода

Avoid remapping of temporary <Plug> map

Junegunn Choi 12 лет назад
Родитель
Сommit
7ea0b523e5
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      plug.vim

+ 4 - 2
plug.vim

@@ -115,8 +115,10 @@ function! plug#end()
       let commands = type(plug.on) == 1 ? [plug.on] : plug.on
       for cmd in commands
         if cmd =~ '^<Plug>.\+'
-          execute printf(
-          \ "noremap %s :call <SID>lod_map(%s, %s)<CR>", cmd, string(cmd), string(plug))
+          if empty(mapcheck(cmd))
+            execute printf(
+            \ "noremap %s :call <SID>lod_map(%s, %s)<CR>", cmd, string(cmd), string(plug))
+          endif
         elseif !exists(':'.cmd)
           execute printf(
           \ "command! -nargs=* -bang %s call s:lod_cmd(%s, '<bang>', <q-args>, %s)",