Support count of next/previous in visual mode

This commit is contained in:
haya14busa 2014-06-11 02:34:44 +09:00
parent bf093abbdf
commit 7a03e86471
2 changed files with 4 additions and 3 deletions

View File

@ -305,6 +305,7 @@ function! EasyMotion#DotRepeat(visualmode) " {{{
endfunction " }}} endfunction " }}}
function! EasyMotion#NextPrevious(visualmode, direction) " {{{ function! EasyMotion#NextPrevious(visualmode, direction) " {{{
" Move next/previous destination using previous motion regexp " Move next/previous destination using previous motion regexp
let cnt = v:count1 " avoid overwriting
if !has_key(s:previous, 'regexp') if !has_key(s:previous, 'regexp')
call s:Message("Previous targets doesn't exist") call s:Message("Previous targets doesn't exist")
let s:EasyMotion_is_cancelled = 1 let s:EasyMotion_is_cancelled = 1
@ -322,7 +323,7 @@ function! EasyMotion#NextPrevious(visualmode, direction) " {{{
" FIXME: blink highlight " FIXME: blink highlight
silent exec 'normal! gv' silent exec 'normal! gv'
endif endif
for i in range(v:count1) for i in range(cnt)
" Do not treat this motion as 'jump' motion " Do not treat this motion as 'jump' motion
keepjumps call searchpos(re, search_direction) keepjumps call searchpos(re, search_direction)
endfor endfor

View File

@ -237,12 +237,12 @@ xnoremap <silent><Plug>(easymotion-dotrepeat)
noremap <silent><Plug>(easymotion-next) noremap <silent><Plug>(easymotion-next)
\ :<C-u>call EasyMotion#NextPrevious(0,0)<CR> \ :<C-u>call EasyMotion#NextPrevious(0,0)<CR>
xnoremap <silent><Plug>(easymotion-next) xnoremap <silent><Plug>(easymotion-next)
\ <Esc>:<C-u>call EasyMotion#NextPrevious(1,0)<CR> \ :<C-u>call EasyMotion#NextPrevious(1,0)<CR>
noremap <silent><Plug>(easymotion-prev) noremap <silent><Plug>(easymotion-prev)
\ :<C-u>call EasyMotion#NextPrevious(0,1)<CR> \ :<C-u>call EasyMotion#NextPrevious(0,1)<CR>
xnoremap <silent><Plug>(easymotion-prev) xnoremap <silent><Plug>(easymotion-prev)
\ <Esc>:<C-u>call EasyMotion#NextPrevious(1,1)<CR> \ :<C-u>call EasyMotion#NextPrevious(1,1)<CR>
"}}} "}}}
" -- Line Motion {{{ " -- Line Motion {{{