diff --git a/plugin/sneak.vim b/plugin/sneak.vim index ab54eed..d40cdc4 100644 --- a/plugin/sneak.vim +++ b/plugin/sneak.vim @@ -167,6 +167,11 @@ func! sneak#to(op, input, inputlen, count, register, repeatmotion, reverse, incl call s:ft_hook() endif + let in_visual = is_op && 2 != a:inclusive && !a:reverse + if in_visual + norm! v + endif + let nextchar = searchpos('\_.', 'n'.(s.search_options_no_s)) let nudge = !a:inclusive && a:repeatmotion && nextchar == s.dosearch('n') if nudge @@ -183,6 +188,9 @@ func! sneak#to(op, input, inputlen, count, register, repeatmotion, reverse, incl endfor if 0 == max(matchpos) + if in_visual + exe "norm! \" + endif if nudge call sneak#util#nudge(a:reverse) "undo nudge for t endif @@ -235,11 +243,6 @@ func! sneak#to(op, input, inputlen, count, register, repeatmotion, reverse, incl call sneak#util#nudge(a:reverse) "undo nudge for t endif - if is_op && 2 != a:inclusive && !a:reverse - " f/t operations do not apply to the current character; nudge the cursor. - call sneak#util#nudge(1) - endif - if is_op || '' != target call sneak#util#removehl() endif