ZyX wrote:

> > Nesting is indeed limited to one CTRL-O.  Using CTRL-O while already in
> > Insert mode because of a CTRL-O doesn't make sense thus it's not
> > supported.  Mainly because users would get confused because of all the
> > nested modes.  Hitting Esc and not getting back to Normal mode already
> > is confusing if you didn't remember exactly what you were doing.
>
> That does answer a question ``why vim should not have deep nesting'' (and I 
> totally agree with it), not ``why vim has such nesting at all''.
> 
> > I suggest you assume Vim does not have bugs and make it work like that.
> > When you can't make it work we need to reconsider.
>
> When I was marking this as a bug, I did not consider that there can be
> nested insert modes. After you explained why does it happen, I tried
> to search the documentation and found nothing about it.

I have added a remark where i_CTRL-O is explained.  It's probably
explained somewhere already, but I can't find it now.

> Even more, I do not encounter this bug 
> if I press `<C-o>ch' by myself, not inside a mapping:
>     echo $'a\x0fch-\ea\e:wq! result.txt\n' | vim -u NONE -c 'set nocompatible'
> (`\x0f' is `\C-o') results in «-» inside a `result.txt'. Why this does
> not yield the same result as
>     vim -u NONE -c 'set nocompatible' \
>                 -c 'inoremap $ <C-o>ch-' \
>                 -c 'execute "normal a$\ea"' \
>                 -c 'wq! result.txt'
> ? I was using <C-o>c{smth} because it is easier to type for me and never 
> encountered that until I tried to do this in a mapping.

There are some tricks to make CTRL-O work with "." and "rx".  These may
also go into Insert mode, but should be allowed to nest.

I find it illogical to use CTRL-O to use a "c" command.  Why not exit
Insert mode?

-- 
CUSTOMER:     Well, can you hang around a couple of minutes?  He won't be
              long.
MORTICIAN:    Naaah, I got to go on to Robinson's -- they've lost nine today.
CUSTOMER:     Well, when is your next round?
MORTICIAN:    Thursday.
DEAD PERSON:  I think I'll go for a walk.
                                  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/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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

Raspunde prin e-mail lui