vim-patch:8.1.0553: it is not easy to edit a script that was sourced (#9298)

Problem:    It is not easy to edit a script that was sourced.
Solution:   Add a count to ":scriptnames", so that ":script 40" edits the
            script with script ID 40.
07dc18ffa4
This commit is contained in:
Jan Edmund Lazo
2018-11-30 22:43:08 -05:00
committed by Justin M. Keyes
parent 0ce880083d
commit a9e368a705
4 changed files with 51 additions and 11 deletions

View File

@@ -3069,6 +3069,17 @@ theend:
/// ":scriptnames"
void ex_scriptnames(exarg_T *eap)
{
if (eap->addr_count > 0) {
// :script {scriptId}: edit the script
if (eap->line2 < 1 || eap->line2 > script_items.ga_len) {
EMSG(_(e_invarg));
} else {
eap->arg = SCRIPT_ITEM(eap->line2).sn_name;
do_exedit(eap, NULL);
}
return;
}
for (int 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,