Two redraw bugs with relative number, visual block mode and linebreak

56 views
Skip to first unread message

Nazri Ramliy

unread,
Nov 17, 2014, 5:39:21 AM11/17/14
to vim_dev
Steps to reproduce (in a 120 columns by 84 rows terminal):

$ echo $COLUMNS $LINES
74 120
$ {
for i in `seq 1 8`; do printf 'lorem ipsum '; done
echo
for i in `seq 1 4`; do
for i in `seq 1 60`; do printf ' '; done
for i in `seq 1 8`; do printf 'lorem ipsum '; done
echo
done
for i in `seq 1 2`; do
printf ' lorem ipsum'
echo
done
} | vi -u NONE -c 'set rnu linebreak' -

Now visual-block select the last two lines and start insert mode as if
you want to insert common text at the beginning of the two lines:

Gk<c-v>j

Note the relative line numbers, and hit "I"

Bug 1: Notice that the relative numbers above the current cursor is no
longer correct.

Bug 2: Now type one character in that insert mode and notice that the
lines above the cursor is redrawn as if "set nolinebreak" was set. As
soon as you hit escape the lines above the cursor is redrawn again
with the proper effect of "set linebreak".

nazri

Christian Brabandt

unread,
Nov 17, 2014, 2:42:05 PM11/17/14
to vim_dev
On Mo, 17 Nov 2014, Nazri Ramliy wrote:

> Steps to reproduce (in a 120 columns by 84 rows terminal):
>
> $ echo $COLUMNS $LINES
> 74 120
> $ {
> for i in `seq 1 8`; do printf 'lorem ipsum '; done
> echo
> for i in `seq 1 4`; do
> for i in `seq 1 60`; do printf ' '; done
> for i in `seq 1 8`; do printf 'lorem ipsum '; done
> echo
> done
> for i in `seq 1 2`; do
> printf ' lorem ipsum'
> echo
> done
> } | vi -u NONE -c 'set rnu linebreak' -
>
> Now visual-block select the last two lines and start insert mode as if
> you want to insert common text at the beginning of the two lines:
>
> Gk<c-v>j
>
> Note the relative line numbers, and hit "I"
>
> Bug 1: Notice that the relative numbers above the current cursor is no
> longer correct.

Attached patch should fix it.

>
> Bug 2: Now type one character in that insert mode and notice that the
> lines above the cursor is redrawn as if "set nolinebreak" was set. As
> soon as you hit escape the lines above the cursor is redrawn again
> with the proper effect of "set linebreak".

Patch from
https://groups.google.com/d/msg/vim_dev/kv5kg0fZxRQ/1grx0E-XlIUJ
should fix this one.

Best,
Christian
--
Wie man aus Gewohnheit nach einer abgelaufenen Uhr hinsieht, als
wenn sie noch ginge, so blickt man auch wohl einer Schönen ins
Gesicht, als wenn sie noch liebte.
-- Goethe, Maximen und Reflektionen, Nr. 383
relnumber.diff

Bram Moolenaar

unread,
Nov 17, 2014, 4:33:30 PM11/17/14
to Christian Brabandt, vim_dev
Thanks!

> > Bug 2: Now type one character in that insert mode and notice that the
> > lines above the cursor is redrawn as if "set nolinebreak" was set. As
> > soon as you hit escape the lines above the cursor is redrawn again
> > with the proper effect of "set linebreak".
>
> Patch from
> https://groups.google.com/d/msg/vim_dev/kv5kg0fZxRQ/1grx0E-XlIUJ
> should fix this one.

--
Shaw's Principle: Build a system that even a fool can use, and
only a fool will want to use it.

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

Nazri Ramliy

unread,
Nov 17, 2014, 8:08:45 PM11/17/14
to vim_dev
On Tue, Nov 18, 2014 at 3:42 AM, Christian Brabandt <cbl...@256bit.org> wrote:
> On Mo, 17 Nov 2014, Nazri Ramliy wrote:
>
>> Bug 1: Notice that the relative numbers above the current cursor is no
>> longer correct.
>
> Attached patch should fix it.

Yes it does.

>> Bug 2: Now type one character in that insert mode and notice that the
>> lines above the cursor is redrawn as if "set nolinebreak" was set. As
>> soon as you hit escape the lines above the cursor is redrawn again
>> with the proper effect of "set linebreak".
>
> Patch from
> https://groups.google.com/d/msg/vim_dev/kv5kg0fZxRQ/1grx0E-XlIUJ
> should fix this one.

Ditto.

Thanks Christian!

Nazri
Reply all
Reply to author
Forward
0 new messages