Commits

Meikel Brandmeyer  committed 66215f3

Add mode specifier to hasmapto checks

  • Participants
  • Parent commits 4d42ccf

Comments (0)

Files changed (1)

File vim/autoload/vimclojure.vim

 endfunction
 
 function! vimclojure#MapPlug(mode, keys, plug)
-	if !hasmapto("<Plug>Clojure" . a:plug)
+	if !hasmapto("<Plug>Clojure" . a:plug, a:mode)
 		execute a:mode . "map <buffer> <unique> <silent> <LocalLeader>" . a:keys
 					\ . " <Plug>Clojure" . a:plug
 	endif
 	set filetype=clojure
 	let b:vimclojure_namespace = a:namespace
 
-	if !hasmapto("<Plug>ClojureReplEnterHook")
+	if !hasmapto("<Plug>ClojureReplEnterHook", "i")
 		imap <buffer> <silent> <CR> <Plug>ClojureReplEnterHook
 	endif
-	if !hasmapto("<Plug>ClojureReplEvaluate")
+	if !hasmapto("<Plug>ClojureReplEvaluate", "i")
 		imap <buffer> <silent> <C-CR> <Plug>ClojureReplEvaluate
 	endif
-	if !hasmapto("<Plug>ClojureReplHatHook")
+	if !hasmapto("<Plug>ClojureReplHatHook", "n")
 		nmap <buffer> <silent> ^ <Plug>ClojureReplHatHook
 	endif
-	if !hasmapto("<Plug>ClojureReplUpHistory")
+	if !hasmapto("<Plug>ClojureReplUpHistory", "i")
 		imap <buffer> <silent> <C-Up> <Plug>ClojureReplUpHistory
 	endif
-	if !hasmapto("<Plug>ClojureReplDownHistory")
+	if !hasmapto("<Plug>ClojureReplDownHistory", "i")
 		imap <buffer> <silent> <C-Down> <Plug>ClojureReplDownHistory
 	endif