• R/O
  • SSH

vim: コミット

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


コミットメタ情報

リビジョン42561e956a703d9fca0ecdca2617a070514e717e (tree)
日時2022-01-18 23:30:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.4135: Vim9: ":scriptnames" shows unloaded imported autoload script

Commit: https://github.com/vim/vim/commit/6079da7cfb10c798535224c92db7fedd3914cb71
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 18 14:16:59 2022 +0000

patch 8.2.4135: Vim9: ":scriptnames" shows unloaded imported autoload script
Problem: Vim9: ":scriptnames" shows unloaded imported autoload script.
Solution: Mark the unloaded script with "A". (closes https://github.com/vim/vim/issues/9552)

変更サマリ

差分

diff -r ceba1e0d0210 -r 42561e956a70 runtime/doc/repeat.txt
--- a/runtime/doc/repeat.txt Tue Jan 18 14:45:05 2022 +0100
+++ b/runtime/doc/repeat.txt Tue Jan 18 15:30:04 2022 +0100
@@ -380,6 +380,9 @@
380380 :scr[iptnames] List all sourced script names, in the order they were
381381 first sourced. The number is used for the script ID
382382 |<SID>|.
383+ For a script that was used with `import autoload` but
384+ was not actually sourced yet an "A" is shown after the
385+ script ID.
383386 {not available when compiled without the |+eval|
384387 feature}
385388
diff -r ceba1e0d0210 -r 42561e956a70 src/scriptfile.c
--- a/src/scriptfile.c Tue Jan 18 14:45:05 2022 +0100
+++ b/src/scriptfile.c Tue Jan 18 15:30:04 2022 +0100
@@ -1648,16 +1648,22 @@
16481648 }
16491649
16501650 for (i = 1; i <= script_items.ga_len && !got_int; ++i)
1651- if (SCRIPT_ITEM(i)->sn_name != NULL)
1651+ {
1652+ scriptitem_T *si = SCRIPT_ITEM(i);
1653+
1654+ if (si->sn_name != NULL)
16521655 {
1653- home_replace(NULL, SCRIPT_ITEM(i)->sn_name,
1654- NameBuff, MAXPATHL, TRUE);
1655- vim_snprintf((char *)IObuff, IOSIZE, "%3d: %s", i, NameBuff);
1656+ home_replace(NULL, si->sn_name, NameBuff, MAXPATHL, TRUE);
1657+ vim_snprintf((char *)IObuff, IOSIZE, "%3d%s: %s",
1658+ i,
1659+ si->sn_state == SN_STATE_NOT_LOADED ? " A" : "",
1660+ NameBuff);
16561661 msg_putchar('\n');
16571662 msg_outtrans(IObuff);
16581663 out_flush(); // output one line at a time
16591664 ui_breakcheck();
16601665 }
1666+ }
16611667 }
16621668
16631669 # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
diff -r ceba1e0d0210 -r 42561e956a70 src/testdir/test_vim9_import.vim
--- a/src/testdir/test_vim9_import.vim Tue Jan 18 14:45:05 2022 +0100
+++ b/src/testdir/test_vim9_import.vim Tue Jan 18 15:30:04 2022 +0100
@@ -1397,10 +1397,12 @@
13971397 CheckScriptSuccess(lines)
13981398 assert_false(exists("g:toggle_loaded"))
13991399 assert_false(exists("g:toggle_called"))
1400+ assert_match('\d A: \f*[/\\]toggle.vim', execute('scriptnames'))
14001401
14011402 feedkeys("tt", 'xt')
14021403 assert_equal('yes', g:toggle_loaded)
14031404 assert_equal('yes', g:toggle_called)
1405+ assert_match('\d: \f*[/\\]toggle.vim', execute('scriptnames'))
14041406
14051407 feedkeys("xx", 'xt')
14061408 assert_equal('yes', g:doit_called)
diff -r ceba1e0d0210 -r 42561e956a70 src/version.c
--- a/src/version.c Tue Jan 18 14:45:05 2022 +0100
+++ b/src/version.c Tue Jan 18 15:30:04 2022 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 4135,
755+/**/
754756 4134,
755757 /**/
756758 4133,
旧リポジトリブラウザで表示