]> granicus.if.org Git - vim/commitdiff
patch 8.2.1549: "r" fails if 'esckeys' is off and modifyOtherKeys is used v8.2.1549
authorBram Moolenaar <Bram@vim.org>
Sun, 30 Aug 2020 18:46:38 +0000 (20:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 30 Aug 2020 18:46:38 +0000 (20:46 +0200)
Problem:    The "r" command fails for keys with modifiers if 'esckeys' is off
            and modifyOtherKeys is used. (Lauri Tirkkonen)
Solution:   Temporarily disable bracketed paste and modifyOtherKeys if
            'esckeys' is off. (closes #6809)

src/normal.c
src/version.c

index 1ef65092449ff7c80371d341a7dc115f2d94d737..966c1a1faa94addcbcb9551b3d35b4527021992f 100644 (file)
@@ -895,9 +895,23 @@ getcount:
            if (lang && curbuf->b_p_iminsert == B_IMODE_IM)
                im_set_active(TRUE);
 #endif
+           if ((State & INSERT) && !p_ek)
+           {
+               // Disable bracketed paste and modifyOtherKeys here, we won't
+               // recognize the escape sequences with 'esckeys' off.
+               out_str(T_BD);
+               out_str(T_CTE);
+           }
 
            *cp = plain_vgetc();
 
+           if ((State & INSERT) && !p_ek)
+           {
+               // Re-enable bracketed paste mode and modifyOtherKeys
+               out_str(T_BE);
+               out_str(T_CTI);
+           }
+
            if (langmap_active)
            {
                // Undo the decrement done above
index 83bb9dcf0771727150ce7173afa44f9d2cf904bd..d4bca788c52e4df6cbb1d1f12c10c080dda8136c 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1549,
 /**/
     1548,
 /**/