To: vim_dev@googlegroups.com Subject: Patch 9.0.0056 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///