Improve JK motion regex pattern for multibyte

This commit is contained in:
haya14busa 2014-09-28 16:39:02 +09:00
parent 44499bae25
commit 91464bdce4

View File

@ -199,8 +199,9 @@ function! EasyMotion#JK(visualmode, direction) " {{{
if g:EasyMotion_startofline
call s:EasyMotion('^\(\w\|\s*\zs\|$\)', a:direction, a:visualmode ? visualmode() : '', 0)
else
let prev_column = getpos('.')[2] - 1
call s:EasyMotion('^.\{,' . prev_column . '}\zs\(.\|$\)', a:direction, a:visualmode ? visualmode() : '', 0)
let c = col('.')
let pattern = printf('^.\{-}\zs\(\%%<%dv.\%%>%dv\|$\)', c + 1, c)
call s:EasyMotion(pattern, a:direction, a:visualmode ? visualmode() : '', 0)
endif
return s:EasyMotion_is_cancelled
endfunction " }}}