• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン7b8e2bea0ec519c60f380ae23ab2a0c4457bd3f2 (tree)
日時2022-01-18 22:15:06
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.4132: Vim9: wrong error message when autoload script can't be found

Commit: https://github.com/vim/vim/commit/1836d6157828baddd94e1f2c82488031570e444d
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 18 13:14:47 2022 +0000

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.

変更サマリ

差分

diff -r db4583616f61 -r 7b8e2bea0ec5 src/testdir/test_vim9_import.vim
--- a/src/testdir/test_vim9_import.vim Tue Jan 18 14:00:06 2022 +0100
+++ b/src/testdir/test_vim9_import.vim Tue Jan 18 14:15:06 2022 +0100
@@ -1433,9 +1433,21 @@
14331433
14341434 lines =<< trim END
14351435 vim9script
1436+ import autoload './doesNotExist.vim'
1437+ END
1438+ CheckScriptFailure(lines, 'E1264:')
1439+
1440+ lines =<< trim END
1441+ vim9script
1442+ import autoload '/dir/doesNotExist.vim'
1443+ END
1444+ CheckScriptFailure(lines, 'E1264:')
1445+
1446+ lines =<< trim END
1447+ vim9script
14361448 import autoload 'doesNotExist.vim'
14371449 END
1438- CheckScriptFailure(lines, 'E1264:')
1450+ CheckScriptFailure(lines, 'E1053: Could not import "doesNotExist.vim"')
14391451 enddef
14401452
14411453 " test disassembling an auto-loaded function starting with "debug"
diff -r db4583616f61 -r 7b8e2bea0ec5 src/version.c
--- a/src/version.c Tue Jan 18 14:00:06 2022 +0100
+++ b/src/version.c Tue Jan 18 14:15:06 2022 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 4132,
755+/**/
754756 4131,
755757 /**/
756758 4130,
diff -r db4583616f61 -r 7b8e2bea0ec5 src/vim9script.c
--- a/src/vim9script.c Tue Jan 18 14:00:06 2022 +0100
+++ b/src/vim9script.c Tue Jan 18 14:15:06 2022 +0100
@@ -411,7 +411,7 @@
411411 int ret = FAIL;
412412 char_u *as_name = NULL;
413413 typval_T tv;
414- int sid = -1;
414+ int sid = -2;
415415 int res;
416416 long start_lnum = SOURCING_LNUM;
417417 garray_T *import_gap;
@@ -519,7 +519,7 @@
519519
520520 if (res == FAIL || sid <= 0)
521521 {
522- semsg(_(is_autoload && sid <= 0
522+ semsg(_(is_autoload && sid == -2
523523 ? e_autoload_import_cannot_use_absolute_or_relative_path
524524 : e_could_not_import_str), tv.vval.v_string);
525525 goto erret;
旧リポジトリブラウザで表示