Skip to content

Commit 4d05af0

Browse files
committed
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Problem: Vim9: E1030 error when using empty string for term_sendkeys(). Solution: Don't check for an invalid type unless the terminal can't be found. (closes #7382)
1 parent aeb313f commit 4d05af0

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/terminal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4595,12 +4595,12 @@ term_get_buf(typval_T *argvars, char *where)
45954595
{
45964596
buf_T *buf;
45974597

4598-
(void)tv_get_number(&argvars[0]); // issue errmsg if type error
45994598
++emsg_off;
46004599
buf = tv_get_buf(&argvars[0], FALSE);
46014600
--emsg_off;
46024601
if (buf == NULL || buf->b_term == NULL)
46034602
{
4603+
(void)tv_get_number(&argvars[0]); // issue errmsg if type error
46044604
ch_log(NULL, "%s: invalid buffer argument", where);
46054605
return NULL;
46064606
}

src/testdir/test_termcodes.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,14 +1896,14 @@ endfunc
18961896

18971897
func Test_list_builtin_terminals()
18981898
CheckRunVimInTerminal
1899-
let buf = RunVimInTerminal('', #{rows: 14})
1900-
call term_sendkeys(buf, ":set cmdheight=3\<CR>")
1901-
call TermWait(buf, 100)
1902-
call term_sendkeys(buf, ":set term=xxx\<CR>")
1903-
call TermWait(buf, 100)
1904-
call assert_match('builtin_dumb', term_getline(buf, 11))
1905-
call assert_match('Not found in termcap', term_getline(buf, 12))
1906-
call StopVimInTerminal(buf)
1899+
call RunVimInTerminal('', #{rows: 14})
1900+
call term_sendkeys('', ":set cmdheight=3\<CR>")
1901+
call TermWait('', 100)
1902+
call term_sendkeys('', ":set term=xxx\<CR>")
1903+
call TermWait('', 100)
1904+
call assert_match('builtin_dumb', term_getline('', 11))
1905+
call assert_match('Not found in termcap', term_getline('', 12))
1906+
call StopVimInTerminal('')
19071907
endfunc
19081908

19091909
func GetEscCodeCSI27(key, modifier)

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2061,
753755
/**/
754756
2060,
755757
/**/

0 commit comments

Comments
 (0)