This patch fixes the problem I described here: 
https://groups.google.com/forum/#!topic/vim_dev/8bXZRbsj5Tc

When a character is found after <Esc> is pressed in insert mode, the buffer 
length is incremented, but the typebuf.tb_noremap flag isn't set, so it uses 
whatever was in there already. That's why the problem was intermittent. 
Disabling that special case 'if' statement worked because it removed the call 
to incar(). Setting notimeout and nottimeout worked because it specifically 
checks for that in the 'if' statement.

This also fixes other key codes in insert mode. I had disabled the vitality 
plugin (which makes focus autocommands work in a terminal) when running Cygwin 
because half the time it would insert literally <F24> or <F25> instead of doing 
the mapping (vitality maps to those keys as hooks for the autocommands). It 
turns out that was caused by the same bug.

Very simple fix, but it was really challenging to find the cause.

diff --git a/getchar.c b/getchar.c
index c4ffb4b..d1a9516 100644
--- a/getchar.c
+++ b/getchar.c
@@ -2731,6 +2731,8 @@ vgetorpeek(advance)
                }
                if (c < 0)
                    continue;   /* end of input script reached */
+               for (n = 1; n <= c; ++n) /* allow mapping for just typed 
characters */
+                   typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES;
                typebuf.tb_len += c;
 
                /* buffer full, don't map */

-- 
-- 
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.
diff --git a/getchar.c b/getchar.c
index c4ffb4b..d1a9516 100644
--- a/getchar.c
+++ b/getchar.c
@@ -2731,6 +2731,8 @@ vgetorpeek(advance)
 		}
 		if (c < 0)
 		    continue;	/* end of input script reached */
+		for (n = 1; n <= c; ++n) /* allow mapping for just typed characters */
+		    typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES;
 		typebuf.tb_len += c;
 
 		/* buffer full, don't map */

Raspunde prin e-mail lui