]> granicus.if.org Git - vim/commitdiff
patch 7.4.870 v7.4.870
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Sep 2015 16:29:39 +0000 (18:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Sep 2015 16:29:39 +0000 (18:29 +0200)
Problem:    May get into an invalid state when using getchar() in an
            expression mapping.
Solution:   Anticipate mod_mask to change. (idea by Yukihiro Nakadaira)

src/getchar.c
src/version.c

index 87588a93ac40f1b3a1e3e97a65d4981fa5ea9619..f4ec991b09e7cff3158e073e598bc1cf546cb828 100644 (file)
@@ -1630,13 +1630,16 @@ vgetc()
       last_recorded_len = 0;
       for (;;)                 /* this is done twice if there are modifiers */
       {
+       int did_inc = FALSE;
+
        if (mod_mask)           /* no mapping after modifier has been read */
        {
            ++no_mapping;
            ++allow_keys;
+           did_inc = TRUE;     /* mod_mask may change value */
        }
        c = vgetorpeek(TRUE);
-       if (mod_mask)
+       if (did_inc)
        {
            --no_mapping;
            --allow_keys;
index bc1e5550ca6e9b7ec5a35e10a88cf9d0d5dcb86c..0cb1fc62b59a78989c90f2d5a76e129d7d5c93b3 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    870,
 /**/
     869,
 /**/