]> granicus.if.org Git - vim/commitdiff
patch 8.0.1356: using simalt in a GUIEnter autocommand inserts characters v8.0.1356
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Nov 2017 19:47:40 +0000 (20:47 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Nov 2017 19:47:40 +0000 (20:47 +0100)
Problem:    Using simalt in a GUIEnter autocommand inserts strange characters.
            (Chih-Long Chang)
Solution:   Ignore K_NOP in Insert mode. (closes #2379)

src/edit.c
src/ex_getln.c
src/version.c

index d960de359ab60b17198dca9a2c0093c95127baf2..bf2cf314043c09f4daf3488880253e613e4709e8 100644 (file)
@@ -781,7 +781,7 @@ edit(
 #endif
 
        /*
-        * Get a character for Insert mode.  Ignore K_IGNORE.
+        * Get a character for Insert mode.  Ignore K_IGNORE and K_NOP.
         */
        if (c != K_CURSORHOLD)
            lastc = c;          /* remember the previous char for CTRL-D */
@@ -798,7 +798,7 @@ edit(
            do
            {
                c = safe_vgetc();
-           } while (c == K_IGNORE);
+           } while (c == K_IGNORE || c == K_NOP);
 
 #ifdef FEAT_AUTOCMD
        /* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
index 02d03b4e1a3668c2d9f127a2e29f29032fad9f37..4202b036e40d5df9e6f79e60b887191009f59601 100644 (file)
@@ -417,12 +417,12 @@ getcmdline(
 
        cursorcmd();            /* set the cursor on the right spot */
 
-       /* Get a character.  Ignore K_IGNORE, it should not do anything, such
-        * as stop completion. */
+       /* Get a character.  Ignore K_IGNORE and K_NOP, they should not do
+        * anything, such as stop completion. */
        do
        {
            c = safe_vgetc();
-       } while (c == K_IGNORE);
+       } while (c == K_IGNORE || c == K_NOP);
 
        if (KeyTyped)
        {
index 0be4be46bb1f3a2f3018e6e255b0e64b23efc51a..50e3f16000beb939eb9dd1ac9a0fd153a643388b 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1356,
 /**/
     1355,
 /**/