Hitting Reply, I didn't realize this post of mine was only sent to Bram.
It might be of interest to others, so I am forwarding to the group now.

Best regards,
   Boyko


---------- Forwarded message ----------
From: Boyko Bantchev <[email protected]>
Date: 6 August 2010 15:25
Subject: Re: Vim 7.3d ready for beta testing
To: Bram Moolenaar <[email protected]>


On 6 August 2010 00:15, Bram Moolenaar <[email protected]> wrote:
> Try this:
>
>       :while 1 | let s = input('') | echo s "\n" | endw
>
> Not sure this is a bug.  If someone wants to erase the typed text this
> would work now but not when making it work the way you suggest.

Bram,

I see what you mean but I find the use of input() in combination
with echo *very* confusing the way it is now.

First, it seems to me that having to re-echo what has been just
typed is more unnatural than having to erase it when it is not needed.
Erasure should be possible through printing \r or some amount of \b-s,
provided that after input() is done we are on the same line.

See the discussion two years ago

http://groups.google.com/group/vim_use/browse_thread/thread/84bebe4fa57a7618?fwc=1&pli=1

where the current behaviour of input() did look erroneous to whoever
posted – including you :)

Second, the way input() interacts with echo is rather strange.
Let's start from assuming (the documentation does not specify this)
that input() starts on a new line.  Then, in the expression you gave

   while 1 | let s = input('') | echo s "\n" | endw

why do we need printing the final \n?  I'd expect the input() after
that \n to leave a blank line but it doesn't.

Also, how does echo manage to print on the same line as input(), when
the documentation says that echo “… starts on a new line”?

But does indeed input() itself start on a new line?  Trying

   echo ">>>" | let s = input('')

seems to prove so.  However, extending this to

   echo ">>>" | let s = input('') | echo s "\n"

brings quite a surprise: now the input()'s implicit echo is partially (!)
retained and repeated by the explicit echo.  See also

   while 1 | echo ">>>" | let s = input('') | echo "\n" | endw

in that respect.  And try

   while 1 | echo ">>>" | let s = input('') | endw

typing in at least several lines for a complete amazement …
Finally, try

   while 1 | let s = input('') | echo s "\n" | echo "...\n" | endw

which appears to print a ...\n after each input line.  Again, how
does the second echo *not* leave a blank line where it should by
definition?

In fact, echo alone behaves strangely.  Try

   echo 'abc' | echo '' | echo 'def'

or even better

   for s in ['abc', '', 'def'] | echo s | endfor

It turns out that echo starts on a new line only when its argument
is a non-empty string.  (And still works even more strangely in
combination with input().)


> I see this too.  I can fix it with this change:
>
> --- a/gui_gtk_x11.c     2010-07-25 15:48:22.000000000 +0200
> +++ b/gui_gtk_x11.c     2010-08-05 23:09:43.000000000 +0200
> ...

I know nothing of that ...   I only remember that combined accents
worked correctly in 7.0, if that is any useful information.

Best regards,
  Boyko

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

Reply via email to