Mercurial > vim
comparison src/terminal.c @ 23029:bc3a083b50cb v8.2.2061
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Commit: https://github.com/vim/vim/commit/4d05af0a64c2e26b13d2ad571debbf5f3b6d384e
Author: Bram Moolenaar <Bram@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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 27 Nov 2020 21:00:04 +0100 |
parents | 38324d4f1c94 |
children | fabd80ec9620 |
comparison
equal
deleted
inserted
replaced
23028:39294d54c929 | 23029:bc3a083b50cb |
---|---|
4593 static buf_T * | 4593 static buf_T * |
4594 term_get_buf(typval_T *argvars, char *where) | 4594 term_get_buf(typval_T *argvars, char *where) |
4595 { | 4595 { |
4596 buf_T *buf; | 4596 buf_T *buf; |
4597 | 4597 |
4598 (void)tv_get_number(&argvars[0]); // issue errmsg if type error | |
4599 ++emsg_off; | 4598 ++emsg_off; |
4600 buf = tv_get_buf(&argvars[0], FALSE); | 4599 buf = tv_get_buf(&argvars[0], FALSE); |
4601 --emsg_off; | 4600 --emsg_off; |
4602 if (buf == NULL || buf->b_term == NULL) | 4601 if (buf == NULL || buf->b_term == NULL) |
4603 { | 4602 { |
4603 (void)tv_get_number(&argvars[0]); // issue errmsg if type error | |
4604 ch_log(NULL, "%s: invalid buffer argument", where); | 4604 ch_log(NULL, "%s: invalid buffer argument", where); |
4605 return NULL; | 4605 return NULL; |
4606 } | 4606 } |
4607 return buf; | 4607 return buf; |
4608 } | 4608 } |