Fix dotrepeat with count
- s:EasyMotion always reset s:flag, s:current - use for instead of while
This commit is contained in:
parent
47f8bbc121
commit
cd63e50838
@ -281,6 +281,8 @@ function! EasyMotion#Repeat(visualmode) " {{{
|
|||||||
return s:EasyMotion_is_cancelled
|
return s:EasyMotion_is_cancelled
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
function! EasyMotion#DotRepeat(visualmode) " {{{
|
function! EasyMotion#DotRepeat(visualmode) " {{{
|
||||||
|
let cnt = v:count1 " avoid overwriting
|
||||||
|
|
||||||
" Repeat previous '.' motion with previous targets and operator
|
" Repeat previous '.' motion with previous targets and operator
|
||||||
if !has_key(s:dot_repeat, 'regexp')
|
if !has_key(s:dot_repeat, 'regexp')
|
||||||
call s:Message("Previous motion doesn't exist")
|
call s:Message("Previous motion doesn't exist")
|
||||||
@ -291,16 +293,16 @@ function! EasyMotion#DotRepeat(visualmode) " {{{
|
|||||||
let re = s:dot_repeat.regexp
|
let re = s:dot_repeat.regexp
|
||||||
let direction = s:dot_repeat.direction
|
let direction = s:dot_repeat.direction
|
||||||
let is_inclusive = s:dot_repeat.is_inclusive
|
let is_inclusive = s:dot_repeat.is_inclusive
|
||||||
let s:flag.within_line = s:dot_repeat.line_flag
|
|
||||||
let s:flag.bd_t = s:dot_repeat.bd_t_flag
|
|
||||||
|
|
||||||
let s:current.is_operator = 1
|
for i in range(cnt)
|
||||||
let i = 0
|
" s:EasyMotion() always call reset s:flag & s:current
|
||||||
while i < v:count1
|
let s:flag.dot_repeat = 1
|
||||||
let s:flag.dot_repeat = 1 " s:EasyMotion() always call reset
|
let s:flag.within_line = s:dot_repeat.line_flag
|
||||||
|
let s:flag.bd_t = s:dot_repeat.bd_t_flag
|
||||||
|
let s:current.is_operator = 1
|
||||||
|
|
||||||
silent call s:EasyMotion(re, direction, 0, is_inclusive)
|
silent call s:EasyMotion(re, direction, 0, is_inclusive)
|
||||||
let i += 1
|
endfor
|
||||||
endwhile
|
|
||||||
return s:EasyMotion_is_cancelled
|
return s:EasyMotion_is_cancelled
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
function! EasyMotion#NextPrevious(visualmode, direction) " {{{
|
function! EasyMotion#NextPrevious(visualmode, direction) " {{{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user