Use matchaddpos() if possible
This commit is contained in:
parent
e2aae85588
commit
57371aed8f
@ -985,9 +985,14 @@ function! s:PromptUser(groups) "{{{
|
|||||||
else
|
else
|
||||||
let _hl_group = g:EasyMotion_hl2_second_group_target
|
let _hl_group = g:EasyMotion_hl2_second_group_target
|
||||||
endif
|
endif
|
||||||
call EasyMotion#highlight#add_highlight(
|
if exists('*matchaddpos')
|
||||||
\ '\%' . line_num . 'l' . target_col_regexp,
|
call EasyMotion#highlight#add_pos_highlight(
|
||||||
\ _hl_group)
|
\ line_num, col_num, _hl_group)
|
||||||
|
else
|
||||||
|
call EasyMotion#highlight#add_highlight(
|
||||||
|
\ '\%' . line_num . 'l' . target_col_regexp,
|
||||||
|
\ _hl_group)
|
||||||
|
endif
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" Add marker/target length difference for multibyte compensation
|
" Add marker/target length difference for multibyte compensation
|
||||||
|
@ -173,6 +173,9 @@ endfunction "}}}
|
|||||||
function! EasyMotion#highlight#add_highlight(re, group) "{{{
|
function! EasyMotion#highlight#add_highlight(re, group) "{{{
|
||||||
call add(s:h.ids[a:group], matchadd(a:group, a:re, s:priorities[a:group]))
|
call add(s:h.ids[a:group], matchadd(a:group, a:re, s:priorities[a:group]))
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
function! EasyMotion#highlight#add_pos_highlight(line_num, col_num, group) "{{{
|
||||||
|
call add(s:h.ids[a:group], matchaddpos(a:group, [[a:line_num, a:col_num]], s:priorities[a:group]))
|
||||||
|
endfunction "}}}
|
||||||
function! EasyMotion#highlight#attach_autocmd() "{{{
|
function! EasyMotion#highlight#attach_autocmd() "{{{
|
||||||
" Reference: https://github.com/justinmk/vim-sneak
|
" Reference: https://github.com/justinmk/vim-sneak
|
||||||
augroup plugin-easymotion
|
augroup plugin-easymotion
|
||||||
|
Loading…
Reference in New Issue
Block a user