Ingo Karkat wrote:

> Great input on other interactive commands being affected by this as
> well; this increases the importance of a fix.

You are mistaken, this is not a bug but exactly how it is supposed to
work.

The :normal command executes characters as if you type them.  And the
confirmation of the substitute is just another character to type.  Thus
that must be part of the :normal command argument.

Consider the "f" command.  It takes an argument, the character to find.
So the user has to type that.  But ":normal fx" includes that typed
character, Vim won't prompt the user.

The implementation puts the argument of :normal in the input buffer and
executes until it is empty.  It's impossible to tell if getting the next
character should NOT come from the input buffer, but ask the user
directly.

The only thing we could do is that when the input buffer is empty,
instead of getting back to the Normal state, just leave it whereever we
are and get further characters from the user.  This is very tricky to
implement, since :normal has put typeahead to the side, and we are
anywhere in the code waiting or a character.  We can't really restore
the typeahead there.  Thus we would get stuck until the Normal mode
command finishes, and then restore typeahead.  It's a bit dangerous, but
it might work.

Anyway, this only solves the problem if the command that you want to
prompt the user is at the very end of the :normal command.

> It don't follow your interpretation of `:h :normal`; it think
> _complete command_ just means that the key sequence must end in
> something that Vim can execute (and then return to normal mode after
> it). As the `:substitute` ends with `<CR>`, that's given there.
> 
> I think what's missing is an implementation that user queries inside
> internal Vim commands (as in `:s_c` and `z=`) need to consider the
> circumstances of running under `:normal`. For mappings, there's
> `inputsave()` for that; a similar internal implementation (that may be
> as simple as changing an internal flag; I'm unfortunately not familiar
> with internals) is needed here.

I think there are other solutions instead of using :normal.

-- 
GUARD #1:  What, ridden on a horse?
ARTHUR:    Yes!
GUARD #1:  You're using coconuts!
ARTHUR:    What?
GUARD #1:  You've got two empty halves of coconut and you're bangin' 'em
           together.
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- 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    ///

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui