Merge branch 'matchaddpos'

This commit is contained in:
haya14busa 2014-06-18 13:00:58 +09:00
commit cb801bca48
2 changed files with 11 additions and 3 deletions

View File

@ -985,9 +985,14 @@ function! s:PromptUser(groups) "{{{
else
let _hl_group = g:EasyMotion_hl2_second_group_target
endif
call EasyMotion#highlight#add_highlight(
\ '\%' . line_num . 'l' . target_col_regexp,
\ _hl_group)
if exists('*matchaddpos')
call EasyMotion#highlight#add_pos_highlight(
\ 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

View File

@ -173,6 +173,9 @@ endfunction "}}}
function! EasyMotion#highlight#add_highlight(re, group) "{{{
call add(s:h.ids[a:group], matchadd(a:group, a:re, s:priorities[a:group]))
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() "{{{
" Reference: https://github.com/justinmk/vim-sneak
augroup plugin-easymotion