From 99ef64101261b929996426f712ffd01549120fde Mon Sep 17 00:00:00 2001 From: Dario Sneidermanis Date: Fri, 6 Sep 2013 12:22:04 -0300 Subject: [PATCH] Fix mapping shadowing Use empty() instad of ! when testing for string emptiness. if !'foo' == !'' | echo 'facepalm!' | endif --- plugin/signify.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/signify.vim b/plugin/signify.vim index 5a22485..a5f01f6 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -62,33 +62,33 @@ nnoremap (signify-toggle) :call sy#toggle() if exists('g:signify_mapping_next_hunk') execute 'nmap '. g:signify_mapping_next_hunk .' (signify-next-hunk)' -elseif !hasmapto('(signify-next-hunk)') && !maparg('gj', 'n') +elseif !hasmapto('(signify-next-hunk)') && empty(maparg('gj', 'n')) nmap gj (signify-next-hunk) endif if exists('g:signify_mapping_prev_hunk') execute 'nmap '. g:signify_mapping_prev_hunk .' (signify-prev-hunk)' -elseif !hasmapto('(signify-prev-hunk)') && !maparg('gk', 'n') +elseif !hasmapto('(signify-prev-hunk)') && empty(maparg('gk', 'n')) nmap gk (signify-prev-hunk) endif if exists('g:signify_mapping_toggle_highlight') execute 'nmap '. g:signify_mapping_toggle_highlight .' (signify-toggle-highlight)' -elseif !hasmapto('(signify-toggle-highlight)') && !maparg('gh', 'n') +elseif !hasmapto('(signify-toggle-highlight)') && empty(maparg('gh', 'n')) nmap gh (signify-toggle-highlight) endif if exists('g:signify_mapping_toggle') execute 'nmap '. g:signify_mapping_toggle .' (signify-toggle)' -elseif !hasmapto('(signify-toggle)') && !maparg('gt', 'n') +elseif !hasmapto('(signify-toggle)') && empty(maparg('gt', 'n')) nmap gt (signify-toggle) endif -if !maparg(']c', 'n') +if empty(maparg(']c', 'n')) nmap ]c (signify-next-hunk) endif -if !maparg('[c', 'n') +if empty(maparg('[c', 'n')) nmap [c (signify-prev-hunk) endif