From b1cae9237e945803a2988f30d456e5bafb7b44f6 Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Fri, 24 Jun 2016 07:01:35 -0700 Subject: [PATCH] Omit a count of 1 for mappings This fixes motions like % whose meanings change when a count is supplied --- plugin/exchange.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/exchange.vim b/plugin/exchange.vim index bd3656b..f2141cd 100644 --- a/plugin/exchange.vim +++ b/plugin/exchange.vim @@ -326,10 +326,10 @@ endfunction highlight default link ExchangeRegion IncSearch -nnoremap (Exchange) ':set operatorfunc=exchange_set'.v:count1.'g@' +nnoremap (Exchange) ':set operatorfunc=exchange_set'.(v:count1 == 1 ? '' : v:count1).'g@' vnoremap (Exchange) :call exchange_set(visualmode(), 1) nnoremap (ExchangeClear) :call exchange_clear() -nnoremap (ExchangeLine) ':set operatorfunc=exchange_set'.v:count1.'g@_' +nnoremap (ExchangeLine) ':set operatorfunc=exchange_set'.(v:count1 == 1 ? '' : v:count1).'g@_' command! XchangeHighlightToggle call s:highlight_toggle() command! XchangeHighlightEnable call s:highlight_toggle(1)