Loading ...
Sorry, an error occurred while loading the content.

Re: Vim-6.0af doesn't wait for input

Expand Messages
  • Ralf Arens
    ... [ Vim6 doesn t work that way ] ... Event handler as in *autocommand-events* *{event}* ? ... OK, I see the problem. I thought this was clear by breaking
    Message 1 of 3 , May 31, 2001
    • 0 Attachment
      * Bram Moolenaar [2001-05-31 14:22]:
      > Ralf Arens wrote:

      >> in Vim5 I used this to get one char from the user:

      >> fun! Getchar()
      >> let @- = '#'
      >> exe 'norm "-Pr'
      >> exe 'norm x'
      >> echo "you typed ".@-
      >> endfun
      [ Vim6 doesn't work that way ]

      > Right, I have fixed a hole in what ":normal" did. It was already documented
      > that the argument given to ":normal" should be a complete command, but it was
      > not enforced. Now it is. This was required to fix other problems (like not
      > being able to use ":normal" from an event handler).

      Event handler as in "*autocommand-events* *{event}*"?

      > Note that there is ambiguety in these two commands:

      > exe 'norm "-Pr'
      > exe 'norm x'

      > Does this let the user type the argument for the "r" command, or does it mean
      > that the "x" from then next ":normal" is used for it?

      OK, I see the problem. I thought this was clear by breaking the
      :normal-command in two lines -- if I use two lines I wait for user
      input, if put it in one line the input is done by the command itself.

      > By trying it you could find out what Vim does, but it wasn't
      > documented. Thus I think it's allowed to be incomaptible between 5.7
      > and 6.0 here.

      If getchar() is "repaired" (see the other mail), I am happy. ;-)

      >> Vim6 is acting to intelligently here and tries to understand the users
      >> intentions; it is probably correct in the second case, but absolutely
      >> wrong in the first one.

      > ":normal" is not meant to push arbitrary keys into the input buffer. It's
      > only meant to execute a complete command. Otherwise the state that Vim is in
      > becomes very confusing (and encounters several implementation problems).




      If you ignore any Usenet posting which has five or more sentences in all
      caps, is crossposted to five or more newsgroups, or has five or more levels
      of quoting, the result is lossless compression of information.
      -- L. Fitzgerald Sjƶbergs (www.brunching.com) law of Usenet-Filtering
    Your message has been successfully submitted and would be delivered to recipients shortly.