From 70406b717c20eacb712d3f557c1459b40f938396 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 19 Jun 2014 17:44:20 +0900 Subject: [PATCH 1/2] Reduce lines of code a little --- autoload/EasyMotion.vim | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 17c4e16..cbf5a40 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -978,13 +978,11 @@ function! s:PromptUser(groups) "{{{ \ '') " Highlight targets {{{ - if marker_chars_len == 1 - let _hl_group = g:EasyMotion_hl_group_target - elseif i == 0 - let _hl_group = g:EasyMotion_hl2_first_group_target - else - let _hl_group = g:EasyMotion_hl2_second_group_target - endif + let _hl_group = + \ (marker_chars_len == 1) ? g:EasyMotion_hl_group_target + \ : (i == 0) ? g:EasyMotion_hl2_first_group_target + \ : g:EasyMotion_hl2_second_group_target + if exists('*matchaddpos') call EasyMotion#highlight#add_pos_highlight( \ line_num, col_num, _hl_group) From 834f76d27941e27e1275351f0c80d2e6d50b6546 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 19 Jun 2014 17:45:07 +0900 Subject: [PATCH 2/2] Fix highlight of second targets with matchaddpos() --- autoload/EasyMotion.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index cbf5a40..389b1db 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -985,7 +985,7 @@ function! s:PromptUser(groups) "{{{ if exists('*matchaddpos') call EasyMotion#highlight#add_pos_highlight( - \ line_num, col_num, _hl_group) + \ line_num, col_num + col_add, _hl_group) else call EasyMotion#highlight#add_highlight( \ '\%' . line_num . 'l' . target_col_regexp,