Wednesday, November 11, 2015

Re: gv on Windows

diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -7993,6 +7993,9 @@ nv_g_cmd(cap)
check_cursor();
VIsual = curwin->w_cursor;
curwin->w_cursor = tpos;
+ /* need to adjust cursor position */
+ if (*p_sel == 'e')
+ inc_cursor();
check_cursor();
update_topline();
/*
diff --git a/src/testdir/test94.in b/src/testdir/test94.in
--- a/src/testdir/test94.in
+++ b/src/testdir/test94.in
@@ -210,6 +210,14 @@ k$v$p
:-2yank
$v$p
:$put ='---'
+:
+:$put =''
+:$put ='gv in exclusive select mode'
+:$put ='zzz '
+:$put ='yyy '
+:set selection=exclusive
+kv3lyjv3lpgvcxxx
+:$put ='---'
:/^start:/+2,$w! test.out
:q!
ENDTEST
Hi Yongwei!

On Mi, 11 Nov 2015, Yongwei Wu wrote:

> If selection=exclusive (result of behave mswin), and you paste on a visual
> area, gv selects one fewer character than if selection=inclusive. The latter
> seems more natural.
>
> Is this a bug? If no, is there a way to achieve the same result as selection=
> inclusive?

Looks like a bug. Here is a patch, including a test.

Best,
Christian
--
Es gibt Tiere, die kein Fleisch fressen, z.B. unsere Kühe. Wenn wir
das Experiment machen könnten, eine Ochsenherde mit Fleisch zu
füttern, so würden die Ochsen verrückt.
-- Rudolf Steiner

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: