Patch 8.2.2061

8 views
Skip to first unread message

Tony Mechelynck

unread,
Nov 28, 2020, 1:52:14 AM11/28/20
to vim_dev
After all, since the patch is available on the repos, I thought I
could just as well send it to where it's missing. Here's the metadata:

user: Bram Moolenaar <Br...@vim.org>
date: Fri Nov 27 21:00:04 2020 +0100
files: src/terminal.c src/testdir/test_termcodes.vim src/version.c
description:
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()

Author: Bram Moolenaar <Br...@vim.org>
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)

The patch itself is the attachment to this message. Unlike those Brams
sends out to the list, it is in unified diff format with (except for
version.c) extra context; it is also (I think) in unix 'fileformat'
(i.e. lines are ended with NL without CR). Normally it shouldn't
matter.

Best regards,
Tony.
8.2.2061

Bram Moolenaar

unread,
Nov 28, 2020, 6:31:22 AM11/28/20
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages