From fea0d68d5a0f8d0d605dc06f9d8c3e59eaa5e4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Tue, 29 Mar 2011 17:03:46 +0200 Subject: [PATCH] Improve visual selection handling --- plugin/EasyMotion.vim | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index 57e15ba..51fc083 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -343,25 +343,15 @@ let coords = s:PromptUser(groups) if ! empty(a:visualmode) - " Store original marks - let m_a = getpos("'a") - let m_b = getpos("'b") - - " Store start/end positions - call setpos("'a", [0, orig_pos[0], orig_pos[1]]) - call setpos("'b", [0, coords[0], coords[1]]) - " Update selection - silent exec 'normal! `a' . a:visualmode . '`b' + call setpos('.', [0, orig_pos[0], orig_pos[1]]) - " Restore original marks - call setpos("'a", m_a) - call setpos("'b", m_b) - else - " Update cursor position - call setpos('.', [0, coords[0], coords[1]]) + exec 'normal! ' . a:visualmode endif + " Update cursor position + call setpos('.', [0, coords[0], coords[1]]) + call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']') catch /.*/ redraw