Patch 8.2.3248

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 29, 2021, 4:26:05 PM7/29/21
to vim...@googlegroups.com

Patch 8.2.3248
Problem: Vim9: error message for wrong input uses wrong line number.
Solution: Use the line number of the start of the command. (issue #8653)
Files: src/vim9script.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3247/src/vim9script.c 2021-07-25 14:13:50.040566339 +0200
--- src/vim9script.c 2021-07-29 22:24:13.162297764 +0200
***************
*** 411,416 ****
--- 411,417 ----
int mult = FALSE;
garray_T names;
garray_T as_names;
+ long start_lnum = SOURCING_LNUM;

tv.v_type = VAR_UNKNOWN;
ga_init2(&names, sizeof(char_u *), 10);
***************
*** 511,516 ****
--- 512,520 ----
}
cmd_end = arg;

+ // Give error messages for the start of the line.
+ SOURCING_LNUM = start_lnum;
+
/*
* find script file
*/
*** ../vim-8.2.3247/src/testdir/test_vim9_script.vim 2021-07-27 22:00:39.753712380 +0200
--- src/testdir/test_vim9_script.vim 2021-07-29 22:24:02.714318042 +0200
***************
*** 1223,1228 ****
--- 1223,1238 ----
writefile(import_star_as_lines_dot_space, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1074:', '', 1, 'Func')

+ var import_func_duplicated =<< trim END
+ vim9script
+ import ExportedInc from './Xexport.vim'
+ import ExportedInc from './Xexport.vim'
+
+ ExportedInc()
+ END
+ writefile(import_func_duplicated, 'Ximport.vim')
+ assert_fails('source Ximport.vim', 'E1073:', '', 3, 'Ximport.vim')
+
var import_star_as_duplicated =<< trim END
vim9script
import * as Export from './Xexport.vim'
*** ../vim-8.2.3247/src/version.c 2021-07-29 21:23:46.829817787 +0200
--- src/version.c 2021-07-29 22:18:54.114896796 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3248,
/**/

--
press CTRL-ALT-DEL for more information

/// 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