Patch 9.0.0056

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 18, 2022, 12:51:37 PM7/18/22
to vim...@googlegroups.com

Patch 9.0.0056
Problem: Wrong line number reported when :cexpr fails in :def function.
Solution: Set line_number before executing :cexpr. (closes #10735)
Files: src/vim9execute.c, src/testdir/test_vim9_func.vim


*** ../vim-9.0.0056/src/vim9execute.c 2022-06-29 13:18:23.890571774 +0100
--- src/vim9execute.c 2022-07-18 17:43:41.597215628 +0100
***************
*** 2786,2791 ****
--- 2786,2792 ----
ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline;
--ectx->ec_stack.ga_len;
tv = STACK_TV_BOT(0);
+ SOURCING_LNUM = iptr->isn_lnum;
res = cexpr_core(&ea, tv);
clear_tv(tv);
if (res == FAIL)
*** ../vim-9.0.0056/src/testdir//test_vim9_func.vim 2022-05-26 21:27:44.000000000 +0100
--- src/testdir//test_vim9_func.vim 2022-07-18 17:37:18.690053967 +0100
***************
*** 4205,4210 ****
--- 4205,4222 ----
v9.CheckScriptSuccess(lines)
enddef

+ def Test_cexpr_errmsg_line_number()
+ var lines =<< trim END
+ vim9script
+ def Func()
+ var qfl = {}
+ cexpr qfl
+ enddef
+ Func()
+ END
+ v9.CheckScriptFailure(lines, 'E777', 2)
+ enddef
+
" The following messes up syntax highlight, keep near the end.
if has('python3')
def Test_python3_command()
*** ../vim-9.0.0056/src/version.c 2022-07-16 17:46:41.673744844 +0100
--- src/version.c 2022-07-18 17:39:21.953785258 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 56,
/**/

--
I AM THANKFUL...
...for the clothes that fit a little too snug because it
means I have more than enough to eat.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages