diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-03-24 11:22:13 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-24 11:22:13 +0000 |
commit | 454ce6737cadb82886f1fc0eb9e8666cc59ae42b (patch) | |
tree | cb8c34f9a6ebc380a2788eed0c0fc14cd4512ca7 /src/scriptfile.c | |
parent | 98b7fe725ec342d28d7c86293098b233c57c4af9 (diff) | |
download | vim-git-454ce6737cadb82886f1fc0eb9e8666cc59ae42b.tar.gz |
patch 8.2.4617: no completion for :scriptnamesv8.2.4617
Problem: No completion for :scriptnames.
Solution: Implement :scriptnames completion. (Yegappan Lakshmanan,
closes #10005)
Diffstat (limited to 'src/scriptfile.c')
-rw-r--r-- | src/scriptfile.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index ae46e7a86..a334b2f9f 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1769,14 +1769,20 @@ ex_scriptnames(exarg_T *eap) { int i; - if (eap->addr_count > 0) + if (eap->addr_count > 0 || *eap->arg != NUL) { // :script {scriptId}: edit the script - if (!SCRIPT_ID_VALID(eap->line2)) + if (eap->addr_count > 0 && !SCRIPT_ID_VALID(eap->line2)) emsg(_(e_invalid_argument)); else { - eap->arg = SCRIPT_ITEM(eap->line2)->sn_name; + if (eap->addr_count > 0) + eap->arg = SCRIPT_ITEM(eap->line2)->sn_name; + else + { + expand_env(eap->arg, NameBuff, MAXPATHL); + eap->arg = NameBuff; + } do_exedit(eap, NULL); } return; |