mirror of
https://github.com/vim/vim.git
synced 2025-08-27 20:13:38 -04:00
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 #9552)
This commit is contained in:
parent
113b8dc111
commit
6079da7cfb
@ -380,6 +380,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
|||||||
:scr[iptnames] List all sourced script names, in the order they were
|
:scr[iptnames] List all sourced script names, in the order they were
|
||||||
first sourced. The number is used for the script ID
|
first sourced. The number is used for the script ID
|
||||||
|<SID>|.
|
|<SID>|.
|
||||||
|
For a script that was used with `import autoload` but
|
||||||
|
was not actually sourced yet an "A" is shown after the
|
||||||
|
script ID.
|
||||||
{not available when compiled without the |+eval|
|
{not available when compiled without the |+eval|
|
||||||
feature}
|
feature}
|
||||||
|
|
||||||
|
@ -1648,16 +1648,22 @@ ex_scriptnames(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i <= script_items.ga_len && !got_int; ++i)
|
for (i = 1; i <= script_items.ga_len && !got_int; ++i)
|
||||||
if (SCRIPT_ITEM(i)->sn_name != NULL)
|
|
||||||
{
|
{
|
||||||
home_replace(NULL, SCRIPT_ITEM(i)->sn_name,
|
scriptitem_T *si = SCRIPT_ITEM(i);
|
||||||
NameBuff, MAXPATHL, TRUE);
|
|
||||||
vim_snprintf((char *)IObuff, IOSIZE, "%3d: %s", i, NameBuff);
|
if (si->sn_name != NULL)
|
||||||
|
{
|
||||||
|
home_replace(NULL, si->sn_name, NameBuff, MAXPATHL, TRUE);
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE, "%3d%s: %s",
|
||||||
|
i,
|
||||||
|
si->sn_state == SN_STATE_NOT_LOADED ? " A" : "",
|
||||||
|
NameBuff);
|
||||||
msg_putchar('\n');
|
msg_putchar('\n');
|
||||||
msg_outtrans(IObuff);
|
msg_outtrans(IObuff);
|
||||||
out_flush(); // output one line at a time
|
out_flush(); // output one line at a time
|
||||||
ui_breakcheck();
|
ui_breakcheck();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
|
# if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
|
||||||
|
@ -1397,10 +1397,12 @@ def Test_autoload_mapping()
|
|||||||
CheckScriptSuccess(lines)
|
CheckScriptSuccess(lines)
|
||||||
assert_false(exists("g:toggle_loaded"))
|
assert_false(exists("g:toggle_loaded"))
|
||||||
assert_false(exists("g:toggle_called"))
|
assert_false(exists("g:toggle_called"))
|
||||||
|
assert_match('\d A: \f*[/\\]toggle.vim', execute('scriptnames'))
|
||||||
|
|
||||||
feedkeys("tt", 'xt')
|
feedkeys("tt", 'xt')
|
||||||
assert_equal('yes', g:toggle_loaded)
|
assert_equal('yes', g:toggle_loaded)
|
||||||
assert_equal('yes', g:toggle_called)
|
assert_equal('yes', g:toggle_called)
|
||||||
|
assert_match('\d: \f*[/\\]toggle.vim', execute('scriptnames'))
|
||||||
|
|
||||||
feedkeys("xx", 'xt')
|
feedkeys("xx", 'xt')
|
||||||
assert_equal('yes', g:doit_called)
|
assert_equal('yes', g:doit_called)
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
4135,
|
||||||
/**/
|
/**/
|
||||||
4134,
|
4134,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user