From 4a7d5a6e5495ae92164a233562c1d87b1e469a2e Mon Sep 17 00:00:00 2001 From: Giuseppe Rota Date: Sun, 8 Apr 2012 13:37:11 +0200 Subject: [PATCH] screwup in map checks --- plugin/delimitMate.vim | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index c09d98a..4f72619 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -329,38 +329,38 @@ endfunction "}}} function! s:ExtraMappings() "{{{ " If pair is empty, delete both delimiters: inoremap delimitMateBS =delimitMate#BS() - if !hasmapto('delimitMateBS','i') && !maparg(''. 'i') + if !hasmapto('delimitMateBS','i') && maparg(''. 'i') == '' silent! imap delimitMateBS endif " If pair is empty, delete closing delimiter: inoremap delimitMateS-BS delimitMate#WithinEmptyPair() ? "\=delimitMate#Del()\" : "\" - if !hasmapto('delimitMateS-BS','i') && !maparg('', 'i') + if !hasmapto('delimitMateS-BS','i') && maparg('', 'i') == '' silent! imap delimitMateS-BS endif " Expand return if inside an empty pair: inoremap delimitMateCR =delimitMate#ExpandReturn() - if b:_l_delimitMate_expand_cr != 0 && !hasmapto('delimitMateCR', 'i') && !maparg('', 'i') + if b:_l_delimitMate_expand_cr != 0 && !hasmapto('delimitMateCR', 'i') && maparg('', 'i') == '' silent! imap delimitMateCR endif " Expand space if inside an empty pair: inoremap delimitMateSpace =delimitMate#ExpandSpace() - if b:_l_delimitMate_expand_space != 0 && !hasmapto('delimitMateSpace', 'i') && !maparg('', 'i') + if b:_l_delimitMate_expand_space != 0 && !hasmapto('delimitMateSpace', 'i') && maparg('', 'i') == '' silent! imap delimitMateSpace endif " Jump over any delimiter: inoremap delimitMateS-Tab =delimitMate#JumpAny("\") - if b:_l_delimitMate_tab2exit && !hasmapto('delimitMateS-Tab', 'i') && !maparg('', 'i') + if b:_l_delimitMate_tab2exit && !hasmapto('delimitMateS-Tab', 'i') && maparg('', 'i') == '' silent! imap delimitMateS-Tab endif " Change char buffer on Del: inoremap delimitMateDel =delimitMate#Del() - if !hasmapto('delimitMateDel', 'i') && !maparg('', 'i') + if !hasmapto('delimitMateDel', 'i') && maparg('', 'i') == '' silent! imap delimitMateDel endif " Flush the char buffer on movement keystrokes or when leaving insert mode: for map in ['Esc', 'Left', 'Right', 'Home', 'End', 'C-Left', 'C-Right'] exec 'inoremap delimitMate'.map.' =Finish()<'.map.'>' - if !hasmapto('delimitMate'.map, 'i') && !maparg('<'.map.'>', 'i') + if !hasmapto('delimitMate'.map, 'i') && maparg('<'.map.'>', 'i') == '' exec 'silent! imap <'.map.'> delimitMate'.map endif endfor @@ -376,28 +376,28 @@ function! s:ExtraMappings() "{{{ " Except when pop-up menu is active: for map in ['Up', 'Down', 'PageUp', 'PageDown', 'S-Down', 'S-Up'] exec 'inoremap delimitMate'.map.' pumvisible() ? "\<'.map.'>" : "\=\Finish()\\<'.map.'>"' - if !hasmapto('delimitMate'.map, 'i') && !maparg('<'.map.'>', 'i') + if !hasmapto('delimitMate'.map, 'i') && maparg('<'.map.'>', 'i') == '' exec 'silent! imap <'.map.'> delimitMate'.map endif endfor " Avoid ambiguous mappings: for map in ['LeftMouse', 'RightMouse'] exec 'inoremap delimitMateM'.map.' =delimitMate#Finish(1)<'.map.'>' - if !hasmapto('delimitMate'.map, 'i') && !maparg('<'.map.'>', 'i') + if !hasmapto('delimitMate'.map, 'i') && maparg('<'.map.'>', 'i') == '' exec 'silent! imap <'.map.'> delimitMateM'.map endif endfor " Jump over next delimiters inoremap delimitMateJumpMany =len(b:_l_delimitMate_buffer) ? delimitMate#Finish(0) : delimitMate#JumpMany() - if !hasmapto('delimitMateJumpMany', 'i') && !maparg("g", 'i') + if !hasmapto('delimitMateJumpMany', 'i') && maparg("g", 'i') == '' imap g delimitMateJumpMany endif " The following simply creates an ambiguous mapping so vim fully processes " the escape sequence for terminal keys, see 'ttimeout' for a rough " explanation, this just forces it to work - if !has('gui_running') && (!exists('g:delimitMate_no_esc_mapping') || !g:delimitMate_no_esc_mapping) && !maparg('OC', 'i') + if !has('gui_running') && (!exists('g:delimitMate_no_esc_mapping') || !g:delimitMate_no_esc_mapping) && maparg('OC', 'i') == '' imap OC endif endfunction "}}}