Refactoring shade regexp for witin line.
This commit is contained in:
parent
245035ba51
commit
5cc559dbe6
@ -1256,27 +1256,18 @@ function! s:EasyMotion(regexp, direction, visualmode, is_inclusive) " {{{
|
|||||||
|
|
||||||
" -- Shade inactive source --------------- {{{
|
" -- Shade inactive source --------------- {{{
|
||||||
if g:EasyMotion_do_shade && targets_len != 1 && s:flag.dot_repeat != 1
|
if g:EasyMotion_do_shade && targets_len != 1 && s:flag.dot_repeat != 1
|
||||||
if a:direction == 1
|
if a:direction == 1 " Backward
|
||||||
" Backward
|
let shade_hl_re = s:flag.within_line
|
||||||
if s:flag.within_line
|
\ ? '^.*\%#'
|
||||||
let shade_hl_re = '^.*\%#'
|
\ : '\%'. win_first_line .'l\_.*\%#'
|
||||||
else
|
elseif a:direction == 0 " Forward
|
||||||
let shade_hl_re = '\%'. win_first_line .'l\_.*\%#'
|
let shade_hl_re = s:flag.within_line
|
||||||
endif
|
\ ? '\%#.*$'
|
||||||
elseif a:direction == 0
|
\ : '\%#\_.*\%'. win_last_line .'l'
|
||||||
" Forward
|
else " Both directions
|
||||||
if s:flag.within_line
|
let shade_hl_re = s:flag.within_line
|
||||||
let shade_hl_re = '\%#.*$'
|
\ ? '^.*\%#.*$'
|
||||||
else
|
\ : '\_.*'
|
||||||
let shade_hl_re = '\%#\_.*\%'. win_last_line .'l'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
" Both directions"
|
|
||||||
if s:flag.within_line
|
|
||||||
let shade_hl_re = '^.*\%#.*$'
|
|
||||||
else
|
|
||||||
let shade_hl_re = '\_.*'
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call EasyMotion#highlight#add_highlight(
|
call EasyMotion#highlight#add_highlight(
|
||||||
|
Loading…
Reference in New Issue
Block a user