Skip to content

Commit 27efc62

Browse files
committed
patch 9.0.0018: going over the end of the typahead
Problem: Going over the end of the typahead. Solution: Put a NUL after the typeahead.
1 parent 3d51ce1 commit 27efc62

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/term.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5393,6 +5393,7 @@ check_termcode(
53935393
if (*tp == ESC && !p_ek && (State & MODE_INSERT))
53945394
continue;
53955395

5396+
tp[len] = NUL;
53965397
key_name[0] = NUL; // no key name found yet
53975398
key_name[1] = NUL; // no key name found yet
53985399
modifiers = 0; // no modifiers yet

src/testdir/test_mapping.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,4 +1715,14 @@ func Test_map_after_timed_out_nop()
17151715
call delete('Xtest_map_after_timed_out_nop')
17161716
endfunc
17171717

1718+
func Test_using_past_typeahead()
1719+
nnoremap :00 0
1720+
exe "norm :set \x80\xfb0=0\<CR>"
1721+
exe "sil norm :0\x0f\<C-U>\<CR>"
1722+
1723+
exe "norm :set \x80\xfb0=\<CR>"
1724+
nunmap :00
1725+
endfunc
1726+
1727+
17181728
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
18,
738740
/**/
739741
17,
740742
/**/

0 commit comments

Comments
 (0)