To: vim_dev@googlegroups.com Subject: Patch 9.0.1573 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1573 Problem: Error for function name has wrong line number. Solution: Set the line number before giving the error. Files: src/vim9execute.c, src/testdir/test_vim9_func.vim *** ../vim-9.0.1572/src/vim9execute.c 2023-04-30 18:50:44.571465836 +0100 --- src/vim9execute.c 2023-05-23 14:37:38.857871697 +0100 *************** *** 4448,4453 **** --- 4448,4454 ---- CLEAR_FIELD(ea); ea.cmd = ea.arg = iptr->isn_arg.string; ga_init2(&lines_to_free, sizeof(char_u *), 50); + SOURCING_LNUM = iptr->isn_lnum; define_function(&ea, NULL, &lines_to_free, 0); ga_clear_strings(&lines_to_free); } *** ../vim-9.0.1572/src/testdir/test_vim9_func.vim 2023-05-15 16:22:34.403075980 +0100 --- src/testdir/test_vim9_func.vim 2023-05-23 14:35:37.482304707 +0100 *************** *** 166,171 **** --- 166,179 ---- delfunc g:Define enddef + def Test_listing_function_error() + var lines =<< trim END + var filler = 123 + func DoesNotExist + END + v9.CheckDefExecFailure(lines, 'E123:', 2) + enddef + def Test_break_in_skipped_block() var lines =<< trim END vim9script *** ../vim-9.0.1572/src/version.c 2023-05-20 16:39:03.341433568 +0100 --- src/version.c 2023-05-23 14:36:42.470061110 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1573, /**/ -- Over the years, I've developed my sense of deja vu so acutely that now I can remember things that *have* happened before ... /// 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 ///