Mercurial > vim
comparison src/terminal.c @ 25338:e2be9f3c5907 v8.2.3206
patch 8.2.3206: Vim9: argument types are not checked at compile time
Commit: https://github.com/vim/vim/commit/0ad871dc4dfe1026e14931a55c225616b63f4c5b
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Jul 23 20:37:56 2021 +0200
patch 8.2.3206: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8611)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 23 Jul 2021 20:45:05 +0200 |
parents | 7e620652bd13 |
children | c4298ed56ffa |
comparison
equal
deleted
inserted
replaced
25337:0e5cb14de298 | 25338:e2be9f3c5907 |
---|---|
4754 * @{count} | 4754 * @{count} |
4755 */ | 4755 */ |
4756 void | 4756 void |
4757 f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED) | 4757 f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED) |
4758 { | 4758 { |
4759 buf_T *buf = term_get_buf(argvars, "term_dumpwrite()"); | 4759 buf_T *buf; |
4760 term_T *term; | 4760 term_T *term; |
4761 char_u *fname; | 4761 char_u *fname; |
4762 int max_height = 0; | 4762 int max_height = 0; |
4763 int max_width = 0; | 4763 int max_width = 0; |
4764 stat_T st; | 4764 stat_T st; |
4769 VTermState *state; | 4769 VTermState *state; |
4770 VTermPos cursor_pos; | 4770 VTermPos cursor_pos; |
4771 | 4771 |
4772 if (check_restricted() || check_secure()) | 4772 if (check_restricted() || check_secure()) |
4773 return; | 4773 return; |
4774 | |
4775 if (in_vim9script() | |
4776 && (check_for_buffer_arg(argvars, 0) == FAIL | |
4777 || check_for_string_arg(argvars, 1) == FAIL | |
4778 || check_for_opt_dict_arg(argvars, 2) == FAIL)) | |
4779 return; | |
4780 | |
4781 buf = term_get_buf(argvars, "term_dumpwrite()"); | |
4774 if (buf == NULL) | 4782 if (buf == NULL) |
4775 return; | 4783 return; |
4776 term = buf->b_term; | 4784 term = buf->b_term; |
4777 if (term->tl_vterm == NULL) | 4785 if (term->tl_vterm == NULL) |
4778 { | 4786 { |
5641 * "term_dumpdiff(filename, filename, options)" function | 5649 * "term_dumpdiff(filename, filename, options)" function |
5642 */ | 5650 */ |
5643 void | 5651 void |
5644 f_term_dumpdiff(typval_T *argvars, typval_T *rettv) | 5652 f_term_dumpdiff(typval_T *argvars, typval_T *rettv) |
5645 { | 5653 { |
5654 if (in_vim9script() | |
5655 && (check_for_string_arg(argvars, 0) == FAIL | |
5656 || check_for_string_arg(argvars, 1) == FAIL | |
5657 || check_for_opt_dict_arg(argvars, 2) == FAIL)) | |
5658 return; | |
5659 | |
5646 term_load_dump(argvars, rettv, TRUE); | 5660 term_load_dump(argvars, rettv, TRUE); |
5647 } | 5661 } |
5648 | 5662 |
5649 /* | 5663 /* |
5650 * "term_dumpload(filename, options)" function | 5664 * "term_dumpload(filename, options)" function |