Re: gv on Windows

72 views
Skip to first unread message

Christian Brabandt

unread,
Nov 11, 2015, 1:26:42 PM11/11/15
to vim, vim-dev
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
selection_bug.diff

Christian Brabandt

unread,
Nov 11, 2015, 1:29:25 PM11/11/15
to vim-dev
On Mi, 11 Nov 2015, Christian Brabandt wrote:
> Looks like a bug. Here is a patch, including a test.

Well, that patch should also include an update for the ok file, so here
is an updated patch.

Best,
Christian
--
Wer die Ursache nicht kennt, nennt die Wirkung Zufall.
-- Werner Mitsch
selection_bug.diff

Christian Brabandt

unread,
Nov 11, 2015, 4:14:01 PM11/11/15
to vim-dev

On Mi, 11 Nov 2015, Christian Brabandt wrote:

> On Mi, 11 Nov 2015, Christian Brabandt wrote:
> > Looks like a bug. Here is a patch, including a test.
>
> Well, that patch should also include an update for the ok file, so here
> is an updated patch.

I must have been confused. The ok file was actually still wrong. Here is
an update.


Best,
Christian
--
An meinen Rechner lasse ich nur Strom und freie Software.
selection_bug.diff

Bram Moolenaar

unread,
Nov 11, 2015, 4:57:00 PM11/11/15
to Christian Brabandt, vim, vim-dev

Christian Brabandt wrote:

> 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.

Currently, when I set 'selection' to exclusive, then gv works just fine.
Thus changing how gv works seems like the wrong solution. It probably
needs to be changed where the paste happens.

Perhaps also add a test for gv used after a normal visual selection,
apparently that's missing.


--
From "know your smileys":
<|-) Chinese
<|-( Chinese and doesn't like these kind of jokes

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Christian Brabandt

unread,
Nov 13, 2015, 3:28:44 AM11/13/15
to vim-dev
Hi Bram!

On Mi, 11 Nov 2015, Bram Moolenaar wrote:

> Currently, when I set 'selection' to exclusive, then gv works just fine.
> Thus changing how gv works seems like the wrong solution. It probably
> needs to be changed where the paste happens.
>
> Perhaps also add a test for gv used after a normal visual selection,
> apparently that's missing.

Oh you are right. I will send an updated patch soon.

Mit freundlichen Grüßen
Christian
--
Fernsehen ist Kaugummi für die Augen.
-- Orson Welles

Christian Brabandt

unread,
Nov 13, 2015, 4:34:21 AM11/13/15
to vim-dev
On Fr, 13 Nov 2015, Christian Brabandt wrote:

> Hi Bram!
>
> On Mi, 11 Nov 2015, Bram Moolenaar wrote:
>
> > Currently, when I set 'selection' to exclusive, then gv works just fine.
> > Thus changing how gv works seems like the wrong solution. It probably
> > needs to be changed where the paste happens.
> >
> > Perhaps also add a test for gv used after a normal visual selection,
> > apparently that's missing.
>
> Oh you are right. I will send an updated patch soon.

Updated patch attached.

Best,
Christian
--
Warum steht Aschermittwoch eigentlich auf dem Kalender? Abgesehen von
Ostern, Pfingsten, Weihnachten, Silvester, Geburtstag und drei Wochen
Urlaub ist doch immer Aschermittwoch.
-- Loriot (Vicco von Bülow)
selection_bug.diff

Christian Brabandt

unread,
Nov 13, 2015, 7:27:30 AM11/13/15
to vim...@googlegroups.com, vim, vim-dev
Hi Yongwei!

On Fr, 13 Nov 2015, Yongwei Wu wrote:

> I think Bram is right. I tested it anyway. While it fixes the
> behaviour in my exact example, it selects one more character after a
> simply y operation.

did you check the second patch?


Best,
Christian
--
Die echten Schriftsteller sind die Gewissensbisse der Menschheit.
-- Ludwig Feuerbach

Yongwei Wu

unread,
Nov 13, 2015, 12:01:38 PM11/13/15
to vim...@googlegroups.com, Christian Brabandt, vim, vim-dev
I think Bram is right. I tested it anyway. While it fixes the
behaviour in my exact example, it selects one more character after a
simply y operation.

> --
> --
> 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+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.




--
Wu Yongwei
URL: http://wyw.dcweb.cn/

Yongwei Wu

unread,
Nov 13, 2015, 12:01:38 PM11/13/15
to vim...@googlegroups.com, vim, vim-dev
Hi Chris,

Where is it? I can't find it in my inbox, spam folder, or the mail
listing archive.

Christian Brabandt

unread,
Nov 14, 2015, 5:12:09 AM11/14/15
to vim...@googlegroups.com, vim, vim-dev
Hi Yongwei!

On Fr, 13 Nov 2015, Yongwei Wu wrote:

> Hi Chris,
>
> Where is it? I can't find it in my inbox, spam folder, or the mail
> listing archive.

https://groups.google.com/d/msg/vim_dev/zec3yCsTPrA/h1T_UdL3BAAJ

Best,
Christian
--
Wer sich entschuldigen kann, ist klar im Vorteil.
-- Hal Faber

Bram Moolenaar

unread,
Nov 14, 2015, 10:16:08 AM11/14/15
to Christian Brabandt, vim-dev

Christian Brabandt wrote:

> > On Mi, 11 Nov 2015, Bram Moolenaar wrote:
> >
> > > Currently, when I set 'selection' to exclusive, then gv works just fine.
> > > Thus changing how gv works seems like the wrong solution. It probably
> > > needs to be changed where the paste happens.
> > >
> > > Perhaps also add a test for gv used after a normal visual selection,
> > > apparently that's missing.
> >
> > Oh you are right. I will send an updated patch soon.
>
> Updated patch attached.

Thanks!

--
hundred-and-one symptoms of being an internet addict:
100. The most exciting sporting events you noticed during summer 1996
was Netscape vs. Microsoft.

Yongwei Wu

unread,
Nov 15, 2015, 9:14:27 AM11/15/15
to vim...@googlegroups.com, vim, vim-dev
On 14 November 2015 at 18:11, Christian Brabandt <cbl...@256bit.org> wrote:
> Hi Yongwei!
>
> On Fr, 13 Nov 2015, Yongwei Wu wrote:
>
>> Hi Chris,
>>
>> Where is it? I can't find it in my inbox, spam folder, or the mail
>> listing archive.
>
> https://groups.google.com/d/msg/vim_dev/zec3yCsTPrA/h1T_UdL3BAAJ

Thanks, Chris. It works perfectly for me!
Reply all
Reply to author
Forward
0 new messages