Omit a count of 1 for mappings

This fixes motions like % whose meanings change when a count is supplied
This commit is contained in:
Tom McDonald 2016-06-24 07:01:35 -07:00
parent d069729b1a
commit b1cae9237e

View File

@ -326,10 +326,10 @@ endfunction
highlight default link ExchangeRegion IncSearch
nnoremap <silent> <expr> <Plug>(Exchange) ':<C-u>set operatorfunc=<SID>exchange_set<CR>'.v:count1.'g@'
nnoremap <silent> <expr> <Plug>(Exchange) ':<C-u>set operatorfunc=<SID>exchange_set<CR>'.(v:count1 == 1 ? '' : v:count1).'g@'
vnoremap <silent> <Plug>(Exchange) :<C-u>call <SID>exchange_set(visualmode(), 1)<CR>
nnoremap <silent> <Plug>(ExchangeClear) :<C-u>call <SID>exchange_clear()<CR>
nnoremap <silent> <expr> <Plug>(ExchangeLine) ':<C-u>set operatorfunc=<SID>exchange_set<CR>'.v:count1.'g@_'
nnoremap <silent> <expr> <Plug>(ExchangeLine) ':<C-u>set operatorfunc=<SID>exchange_set<CR>'.(v:count1 == 1 ? '' : v:count1).'g@_'
command! XchangeHighlightToggle call s:highlight_toggle()
command! XchangeHighlightEnable call s:highlight_toggle(1)