# HG changeset patch # User Bram Moolenaar # Date 1606507204 -3600 # Node ID bc3a083b50cb183a50bb9b01afafde28f72d7879 # Parent 39294d54c929a46d0444b24e9185ab7c69d092a4 patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys() Commit: https://github.com/vim/vim/commit/4d05af0a64c2e26b13d2ad571debbf5f3b6d384e Author: Bram Moolenaar Date: Fri Nov 27 20:55:00 2020 +0100 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) diff --git a/src/terminal.c b/src/terminal.c --- a/src/terminal.c +++ b/src/terminal.c @@ -4595,12 +4595,12 @@ term_get_buf(typval_T *argvars, char *wh { buf_T *buf; - (void)tv_get_number(&argvars[0]); // issue errmsg if type error ++emsg_off; buf = tv_get_buf(&argvars[0], FALSE); --emsg_off; if (buf == NULL || buf->b_term == NULL) { + (void)tv_get_number(&argvars[0]); // issue errmsg if type error ch_log(NULL, "%s: invalid buffer argument", where); return NULL; } diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -1896,14 +1896,14 @@ endfunc func Test_list_builtin_terminals() CheckRunVimInTerminal - let buf = RunVimInTerminal('', #{rows: 14}) - call term_sendkeys(buf, ":set cmdheight=3\") - call TermWait(buf, 100) - call term_sendkeys(buf, ":set term=xxx\") - call TermWait(buf, 100) - call assert_match('builtin_dumb', term_getline(buf, 11)) - call assert_match('Not found in termcap', term_getline(buf, 12)) - call StopVimInTerminal(buf) + call RunVimInTerminal('', #{rows: 14}) + call term_sendkeys('', ":set cmdheight=3\") + call TermWait('', 100) + call term_sendkeys('', ":set term=xxx\") + call TermWait('', 100) + call assert_match('builtin_dumb', term_getline('', 11)) + call assert_match('Not found in termcap', term_getline('', 12)) + call StopVimInTerminal('') endfunc func GetEscCodeCSI27(key, modifier) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2061, +/**/ 2060, /**/ 2059,