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\<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)
  endfunc
  
  func GetEscCodeCSI27(key, modifier)
--- 1896,1909 ----
  
  func Test_list_builtin_terminals()
    CheckRunVimInTerminal
!   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)
*** ../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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202011281131.0ASBV9WM2964147%40masaka.moolenaar.net.

Raspunde prin e-mail lui