mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.4132: Vim9: wrong error message when autoload script can't be found
Problem: Vim9: wrong error message when autoload script can't be found. Solution: Correct check for using autoload with wrong name.
This commit is contained in:
parent
cbbc48f64b
commit
1836d61578
@ -1433,9 +1433,21 @@ def Test_import_autoload_fails()
|
|||||||
|
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
import autoload 'doesNotExist.vim'
|
import autoload './doesNotExist.vim'
|
||||||
END
|
END
|
||||||
CheckScriptFailure(lines, 'E1264:')
|
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
|
enddef
|
||||||
|
|
||||||
" test disassembling an auto-loaded function starting with "debug"
|
" test disassembling an auto-loaded function starting with "debug"
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4132,
|
||||||
/**/
|
/**/
|
||||||
4131,
|
4131,
|
||||||
/**/
|
/**/
|
||||||
|
@ -411,7 +411,7 @@ handle_import(
|
|||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char_u *as_name = NULL;
|
char_u *as_name = NULL;
|
||||||
typval_T tv;
|
typval_T tv;
|
||||||
int sid = -1;
|
int sid = -2;
|
||||||
int res;
|
int res;
|
||||||
long start_lnum = SOURCING_LNUM;
|
long start_lnum = SOURCING_LNUM;
|
||||||
garray_T *import_gap;
|
garray_T *import_gap;
|
||||||
@ -519,7 +519,7 @@ handle_import(
|
|||||||
|
|
||||||
if (res == FAIL || sid <= 0)
|
if (res == FAIL || sid <= 0)
|
||||||
{
|
{
|
||||||
semsg(_(is_autoload && sid <= 0
|
semsg(_(is_autoload && sid == -2
|
||||||
? e_autoload_import_cannot_use_absolute_or_relative_path
|
? e_autoload_import_cannot_use_absolute_or_relative_path
|
||||||
: e_could_not_import_str), tv.vval.v_string);
|
: e_could_not_import_str), tv.vval.v_string);
|
||||||
goto erret;
|
goto erret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user