vim-patch:8.2.3966: when using feedkeys() abbreviations may be blocked

Problem:    When using feedkeys() abbreviations may be blocked.
Solution:   Reset tb_no_abbr_cnt when running out of characters.
            (closes vim/vim#9448)
b37a65e4bf
This commit is contained in:
zeertzjq 2022-02-02 09:46:25 +08:00
parent f4300985d3
commit 3e68973755
2 changed files with 16 additions and 0 deletions

View File

@ -2304,6 +2304,10 @@ static int vgetorpeek(bool advance)
c = ESC;
}
tc = c;
// no chars to block abbreviations for
typebuf.tb_no_abbr_cnt = 0;
break;
}

View File

@ -12,3 +12,15 @@ func Test_feedkeys_x_with_empty_string()
call assert_equal('foo', getline('.'))
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