diff --git a/src/terminal.c b/src/terminal.c --- a/src/terminal.c +++ b/src/terminal.c @@ -4590,22 +4590,22 @@ set_ref_in_term(int copyID) * Returns NULL when the buffer is not for a terminal window and logs a message * with "where". */ static buf_T * term_get_buf(typval_T *argvars, char *where) { 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; } return buf; } static void clear_cell(VTermScreenCell *cell) 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 @@ -1891,24 +1891,24 @@ func Test_get_termcode() let &term = term_save endif set ttybuiltin 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) let key = printf("%d", char2nr(a:key)) let mod = printf("%d", a:modifier) return "\[27;" .. mod .. ';' .. key .. '~' endfunc diff a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -752,2 +752,4 @@ { /* Add new patch number below this line */ +/**/ + 2061, /**/