]> granicus.if.org Git - vim/commitdiff
patch 8.2.3966: when using feedkeys() abbreviations may be blocked v8.2.3966
authorBram Moolenaar <Bram@vim.org>
Sat, 1 Jan 2022 12:42:56 +0000 (12:42 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 Jan 2022 12:42:56 +0000 (12:42 +0000)
Problem:    When using feedkeys() abbreviations may be blocked.
Solution:   Reset tb_no_abbr_cnt when running out of characters.
            (closes #9448)

src/getchar.c
src/testdir/test_feedkeys.vim
src/version.c

index 209ee06f07c866b2a06ef19ddf09397867538592..704d4d3954bf583792c7c539d0814d637496ea07 100644 (file)
@@ -3239,6 +3239,9 @@ vgetorpeek(int advance)
                    if (pending_exmode_active)
                        exmode_active = EXMODE_NORMAL;
 
+                   // no chars to block abbreviation for
+                   typebuf.tb_no_abbr_cnt = 0;
+
                    break;
                }
 
index 38b2f9f6877a3a662ea0581887d70f2d0bc28d56..f343b0174cad0ef5401e2273acba1be356d0b61f 100644 (file)
@@ -13,4 +13,14 @@ func Test_feedkeys_x_with_empty_string()
   quit!
 endfunc
 
+func Test_feedkeys_with_abbreviation()
+  new
+  inoreabbrev trigger value
+  call feedkeys("atrigger ", 'x')
+  call feedkeys("atrigger ", 'x')
+  call assert_equal('value value ', getline(1))
+  bwipe!
+  iunabbrev trigger
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 6499548706c97715a7d647ab24faf41ca694852f..195c3d5eea52df9640e8de5f69432bf01941e1af 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3966,
 /**/
     3965,
 /**/