diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index d19a8e9..7671f3d 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -641,7 +641,7 @@ function! delimitMate#AutoClose() "{{{ exec 'silent! inoremap ' . delim . ' =delimitMate#QuoteDelim("\' . delim . '")' endfor - " Try to fix the use of apostrophes (kept for backward compatibilt): + " Try to fix the use of apostrophes (kept for backward compatibility): " inoremap n't n't for map in b:_l_delimitMate_apostrophes_list exec "silent! inoremap " . map . " " . map @@ -668,16 +668,23 @@ function! delimitMate#ExtraMappings() "{{{ inoremap delimitMateES =delimitMate#ExpandSpace() " Jump out ot any empty pair: inoremap delimitMateSTab =delimitMate#JumpAny("\") - " change char buffer on Del: + " Change char buffer on Del: inoremap delimitMateDel =delimitMate#Del() " Flush the char buffer on movement keystrokes or when leaving insert mode: - for map in ['Esc', 'Left', 'Right', 'Up', 'Down', 'Home', 'End'] + for map in ['Esc', 'Left', 'Right', 'Home', 'End'] exec 'inoremap delimitMate'.map.' =delimitMate#Finish()<'.map.'>' if !hasmapto('delimitMate'.map, 'i') exec 'silent! imap <'.map.'> delimitMate'.map endif endfor - + " Except when pop-up menu is active: + for map in ['Up', 'Down', 'PageUp', 'PageDown', 'S-Down', 'S-Up'] + exec 'inoremap delimitMate'.map.' pumvisible() ? "\<'.map.'>" : "=delimitMate#Finish()<'.map.'>"' + if !hasmapto('delimitMate'.map, 'i') + exec 'silent! imap <'.map.'> delimitMate'.map + endif + endfor + " Avoid ambiguous mappings: for map in ['LeftMouse', 'RightMouse'] exec 'inoremap delimitMateM'.map.' =delimitMate#Finish()<'.map.'>' if !hasmapto('delimitMate'.map, 'i') @@ -720,7 +727,7 @@ function! delimitMate#UnMap() " {{{ \ b:_l_delimitMate_apostrophes_list + \ ['', '', '', '', '', '', ''] + \ ['', '', '', '', '', ''] + - \ ['Home', 'End'] + \ ['', '', '', '', '', ''] let vmaps = \ b:_l_delimitMate_right_delims + @@ -816,7 +823,7 @@ function! delimitMate#TestMappings() "{{{ \ b:_l_delimitMate_apostrophes_list + \ ['', '', '', '', '', '', ''] + \ ['', '', '', '', '', ''] + - \ ['', ''] + \ ['', '', '', '', '', ''] let vmaps = \ b:_l_delimitMate_right_delims +