]> granicus.if.org Git - vim/commitdiff
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys() v8.2.2061
authorBram Moolenaar <Bram@vim.org>
Fri, 27 Nov 2020 19:55:00 +0000 (20:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 27 Nov 2020 19:55:00 +0000 (20:55 +0100)
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)

src/terminal.c
src/testdir/test_termcodes.vim
src/version.c

index 6be757950f7af97411c3dd2701238cdc76417d2e..32e52ee440ff4328a43c4e1e265ece911d5a0b7d 100644 (file)
@@ -4595,12 +4595,12 @@ 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;
     }
index cfbb7ba3cdf1908bd63d43b80d825ddcae286d37..12e4dd3556152ce7d420b2a9fd121604e8fc956a 100644 (file)
@@ -1896,14 +1896,14 @@ endfunc
 
 func Test_list_builtin_terminals()
   CheckRunVimInTerminal
-  let buf = RunVimInTerminal('', #{rows: 14})
-  call term_sendkeys(buf, ":set cmdheight=3\<CR>")
-  call TermWait(buf, 100)
-  call term_sendkeys(buf, ":set term=xxx\<CR>")
-  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\<CR>")
+  call TermWait('', 100)
+  call term_sendkeys('', ":set term=xxx\<CR>")
+  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)
index d86a51e95dc05dcf94ef991c98682e4ce8472647..395aee1a2bfb20282b1a461be17335a1f1251eaa 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2061,
 /**/
     2060,
 /**/