From a4689e85ec5291e8003988f8616c97386bf6c5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Mon, 28 Mar 2011 10:12:08 +0200 Subject: [PATCH] Use substitute() for markers, works better with Unicode --- plugin/EasyMotion.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index 80198c2..b11d3ac 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -163,10 +163,11 @@ if ! has_key(lines, line_num) let current_line = getline(line_num) - let lines[line_num] = { 'orig': current_line, 'marker': split(current_line, '\zs') } + let lines[line_num] = { 'orig': current_line, 'marker': current_line } endif - let lines[line_num]['marker'][col_num - 1] = s:index_to_key[single_group ? element : current_group] + " Substitute marker character + let lines[line_num]['marker'] = substitute(lines[line_num]['marker'], '\%' . col_num . 'c.', s:index_to_key[single_group ? element : current_group], '') " Add highlighting coordinates call add(hl_coords, '\%' . line_num . 'l\%' . col_num . 'c') @@ -208,7 +209,7 @@ catch endtry - call setline(line_num, join(line['marker'], '')) + call setline(line_num, line['marker']) endfor redraw