Hi Marcin!

On So, 18 Mär 2012, Marcin Szamotulski wrote:

> Hello,
> 
> I found a strange behaviour in the message prompt.
> Here is how to reproduce it:
> (1)   :echo join(range(1,100), "\n")
> (2)   move down and up for example: jk
> What happens: the first line is:
> 1echo join(range(1,100), "\n")
> while I think it should be:
> 1
> 
> This becomes more confusing if the list entries are other than just numbers.
> For example split(&rtp, ",") instead of range(1,100) 
> (but the number of path in &rtp must be larger than the number of screen lines
> - which is how I discovered this)

Hi Bram,
the problem is, that after the command has been entered, the command 
will be stored in the scrollback buffer, sb_eol should be set, thus when 
displaying the first message from the scrollback buffer, the command 
will be echoed again and the first line will be written on top of that.

The easy way to fix this is adding an extra newline after the command 
has been entered.

diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -20493,6 +20493,7 @@
                 * may cause a message to appear. */
                if (eap->cmdidx == CMD_echo)
                    msg_start();
+               msg_puts_attr((char_u *)"\n", echo_attr);
            }
            else if (eap->cmdidx == CMD_echo)
                msg_puts_attr((char_u *)" ", echo_attr);


regards,
Christian

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui