Patch 8.2.4132
Problem: Vim9: wrong error message when autoload script can't be found.
Solution: Correct check for using autoload with wrong name.
Files: src/vim9script.c, src/testdir/test_vim9_import.vim
*** ../vim-8.2.4131/src/vim9script.c 2022-01-13 22:05:05.567104513 +0000
--- src/vim9script.c 2022-01-18 13:08:16.337689834 +0000
***************
*** 411,417 ****
int ret = FAIL;
char_u *as_name = NULL;
typval_T tv;
! int sid = -1;
int res;
long start_lnum = SOURCING_LNUM;
garray_T *import_gap;
--- 411,417 ----
int ret = FAIL;
char_u *as_name = NULL;
typval_T tv;
! int sid = -2;
int res;
long start_lnum = SOURCING_LNUM;
garray_T *import_gap;
***************
*** 519,525 ****
if (res == FAIL || sid <= 0)
{
! semsg(_(is_autoload && sid <= 0
? e_autoload_import_cannot_use_absolute_or_relative_path
: e_could_not_import_str), tv.vval.v_string);
goto erret;
--- 519,525 ----
if (res == FAIL || sid <= 0)
{
! semsg(_(is_autoload && sid == -2
? e_autoload_import_cannot_use_absolute_or_relative_path
: e_could_not_import_str), tv.vval.v_string);
goto erret;
*** ../vim-8.2.4131/src/testdir/test_vim9_import.vim 2022-01-18
12:58:24.726772997 +0000
--- src/testdir/test_vim9_import.vim 2022-01-18 13:14:17.377226172 +0000
***************
*** 1433,1441 ****
lines =<< trim END
vim9script
! import autoload 'doesNotExist.vim'
END
CheckScriptFailure(lines, 'E1264:')
enddef
" test disassembling an auto-loaded function starting with "debug"
--- 1433,1453 ----
lines =<< trim END
vim9script
! import autoload './doesNotExist.vim'
! END
! CheckScriptFailure(lines, 'E1264:')
!
! lines =<< trim END
! vim9script
! import autoload '/dir/doesNotExist.vim'
END
CheckScriptFailure(lines, 'E1264:')
+
+ lines =<< trim END
+ vim9script
+ import autoload 'doesNotExist.vim'
+ END
+ CheckScriptFailure(lines, 'E1053: Could not import "doesNotExist.vim"')
enddef
" test disassembling an auto-loaded function starting with "debug"
*** ../vim-8.2.4131/src/version.c 2022-01-18 12:58:24.726772997 +0000
--- src/version.c 2022-01-18 13:09:51.861558455 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4132,
/**/
--
Seen on the back of a biker's vest: If you can read this, my wife fell off.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220118131705.022891C04D4%40moolenaar.net.