vim8.1 - \%V problem

10 views
Skip to first unread message

otti-...@freenet.de

unread,
Oct 13, 2020, 5:35:39 AM10/13/20
to vim...@vim.org

 

Enviroment: Ubuntu 20.04.1 LTS; Terminal: Guake Terminal: 3.6.3

Program: VIM - Vi IMproved 8.1 with Patches: 1-2269

 

The command :'<,'>s/\%V\n/{something}<CR> considers hole line even the selection is e.g. just half the line.

Example:

Hi, how are you

I'm fine, thank you

 

Selection in visual Mode:

Hi, how are you

I'm fine, thank you

 

using command :'<,'>s/\%V\n/?\r<CR> leads to:

Hi, how are you?

I'm fine, thank you?

 

Also the right one should be without the last "?"because with \%V only the selection in visual mode should be searched:

Hi, how are you?

I'm fine, thank you

 

Are there any hints.

Best regards

otti



Christian Brabandt

unread,
Oct 13, 2020, 5:43:28 AM10/13/20
to vim...@vim.org

On Fr, 09 Okt 2020, otti-...@freenet.de wrote:

>
> Enviroment: Ubuntu 20.04.1 LTS; Terminal: Guake Terminal: 3.6.3
> Program: VIM - Vi IMproved 8.1 with Patches: 1-2269
>
> The command :'&lt;,'>s/\%V\n/{something}&lt;CR> considers hole line even the selection is e.g. just half the line.
> Example:
> Hi, how are you
> I'm fine, thank you
>
> Selection in visual Mode:
> Hi, how are you
> I'm fine, thank you
>
> using command :'&lt;,'>s/\%V\n/?\r&lt;CR> leads to:
> Hi, how are you?
> I'm fine, thank you?
>
> Also the right one should be without the last "?"because with \%V only the selection in visual mode should be searched:
> Hi, how are you?
> I'm fine, thank you

It's hard to see in a plain text what you are actually doing. Looking at
the message in google groups archive makes it a whole lot more readable.

I suspect this might actually be a bug here. Can you please post a
complete example using `vim --clean` without using visual indications
but using vim commands to show what you are doing?

Also can you please try this with the latest version from the
github.com/vim/vim repository?

BTW: Does setting the regexpengine (i.e. :set re=1, :set re=2) make a
difference here?


Best,
Christian
--
Angenehm sind die erledigten Arbeiten.
-- Marcus Tullius Cicero (106-43 v.Chr.)
Reply all
Reply to author
Forward
0 new messages