To: vim_dev@googlegroups.com Subject: Patch 8.2.2061 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2061 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) Files: src/terminal.c, src/testdir/test_termcodes.vim *** ../vim-8.2.2060/src/terminal.c 2020-11-15 20:32:54.167882094 +0100 --- src/terminal.c 2020-11-27 20:47:34.319482832 +0100 *************** *** 4595,4606 **** { 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) { ch_log(NULL, "%s: invalid buffer argument", where); return NULL; } --- 4595,4606 ---- { buf_T *buf; ++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; } *** ../vim-8.2.2060/src/testdir/test_termcodes.vim 2020-10-31 16:33:42.847372387 +0100 --- src/testdir/test_termcodes.vim 2020-11-27 20:53:42.761776300 +0100 *************** *** 1896,1909 **** 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) endfunc func GetEscCodeCSI27(key, modifier) --- 1896,1909 ---- func Test_list_builtin_terminals() CheckRunVimInTerminal ! 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) *** ../vim-8.2.2060/src/version.c 2020-11-27 19:13:24.186184976 +0100 --- src/version.c 2020-11-27 20:54:07.741659426 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2061, /**/ -- A computer programmer is a device for turning requirements into undocumented features. It runs on cola, pizza and Dilbert cartoons. Bram Moolenaar /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///