[patch] Undo messages may not be shown

81 προβολές
Παράβλεψη και μετάβαση στο πρώτο μη αναγνωσμένο μήνυμα

Ken Takata

μη αναγνωσμένη,
1 Οκτ 2013, 6:28:59 π.μ.1/10/13
ως vim...@googlegroups.com
Hi,

Sometimes (maybe when scrolling occurs) undo messages like
"2 fewer lines: before #79 7 seconds ago" are not shown.
(Vim 7.4.041 on Windows, 7.3.429 on Linux)

E.g.

1. $ gvim -N -u NONE -U NONE
2. Input a line: `ifoo<CR><Esc>`.
3. Repeat it more than 25 times (= more than the screen lines) using `.`.
4. Go to the first line using `gg`, then undo by using `u`.
Undo message will not be shown.
5. Repeat `ggu` several times.
Undo message will be shown if the file lines becomes fewer than the screen
lines.

Attached patch seems to fix this, but I'm not sure this is the best way.

Regards,
Ken Takata

redraw-after-undo.patch

Bram Moolenaar

μη αναγνωσμένη,
2 Οκτ 2013, 6:52:29 π.μ.2/10/13
ως Ken Takata, vim...@googlegroups.com
No, this forces a redraw of the whole screen. It works because instead
of deleting lines, which causes the message to scroll up and be cleared,
it overwrites the screen.

It's better to find a way to fill keep_msg. Unfortunately there is no
asy way to call smsg() and have msg_attr_keep() called with "keep" set
to TRUE. A global variable would be the easyest, but it's ugly.


--
Not too long ago, cut and paste was done with scissors and glue...

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

Ken Takata

μη αναγνωσμένη,
2 Οκτ 2013, 8:43:21 π.μ.2/10/13
ως vim...@googlegroups.com, Ken Takata
Hi,

2013/10/02 Wed 19:52:29 UTC+9 Bram Moolenaar wrote:
> Ken Takata wrote:
>
> > Hi,
> >
> > Sometimes (maybe when scrolling occurs) undo messages like
> > "2 fewer lines: before #79 7 seconds ago" are not shown.
> > (Vim 7.4.041 on Windows, 7.3.429 on Linux)
> >
> > E.g.
> >
> > 1. $ gvim -N -u NONE -U NONE
> > 2. Input a line: `ifoo<CR><Esc>`.
> > 3. Repeat it more than 25 times (= more than the screen lines) using `.`.
> > 4. Go to the first line using `gg`, then undo by using `u`.
> > Undo message will not be shown.
> > 5. Repeat `ggu` several times.
> > Undo message will be shown if the file lines becomes fewer than the screen
> > lines.
> >
> > Attached patch seems to fix this, but I'm not sure this is the best way.
>
> No, this forces a redraw of the whole screen. It works because instead
> of deleting lines, which causes the message to scroll up and be cleared,
> it overwrites the screen.
>
> It's better to find a way to fill keep_msg. Unfortunately there is no
> asy way to call smsg() and have msg_attr_keep() called with "keep" set
> to TRUE. A global variable would be the easyest, but it's ugly.

Then I think it's better to add a new function smsg_attr_keep().
Please check the attached patch.

BTW, Yukihiro Nakadaira found an easier way to reproduce the problem:

$ vim -u NONE -N
Ofoo<Esc>..uuu

Now we don't need to repeat `.` 25 times ;-)

Regards,
Ken Takata

add-smsg_attr_keep.patch

Yukihiro Nakadaira

μη αναγνωσμένη,
4 Οκτ 2013, 11:28:00 π.μ.4/10/13
ως vim...@googlegroups.com
With this patch, message after undo is ignored when using macro.

$vim -u NONE -N
ofoo<Esc>.....:normal ukkk3dd

Message without patch:
3 fewer lines

Message with patch:
1 line less; before #6  5 seconds ago

--
Yukihiro Nakadaira - yukihiro....@gmail.com
Απάντηση σε όλους
Απάντηση στον συντάκτη
Προώθηση
0 νέα μηνύματα