summaryrefslogtreecommitdiff
path: root/src/usercmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-12 11:25:11 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-12 11:25:11 +0000
commit58ef8a31d7087d495ab1582be5b7a22796ac2451 (patch)
treedbae171d4c49dbe2ba7e89ef94561fa357610e72 /src/usercmd.c
parent0c71114aede81a209b7efc126b4bf19f11d58955 (diff)
downloadvim-git-58ef8a31d7087d495ab1582be5b7a22796ac2451.tar.gz
patch 8.2.3584: "verbose set efm" reports location of the :compiler commandv8.2.3584
Problem: "verbose set efm" reports the location of the :compiler command. (Gary Johnson) Solution: Add the "-keepscript" argument to :command and use it when defining CompilerSet.
Diffstat (limited to 'src/usercmd.c')
-rw-r--r--src/usercmd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/usercmd.c b/src/usercmd.c
index 8ead42c52..0050647ab 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -360,7 +360,7 @@ get_user_cmd_flags(expand_T *xp UNUSED, int idx)
{
static char *user_cmd_flags[] = {
"addr", "bang", "bar", "buffer", "complete",
- "count", "nargs", "range", "register"
+ "count", "nargs", "range", "register", "keepscript"
};
if (idx >= (int)ARRAY_LENGTH(user_cmd_flags))
@@ -735,6 +735,8 @@ uc_scan_attr(
*flags |= UC_BUFFER;
else if (STRNICMP(attr, "register", len) == 0)
*argt |= EX_REGSTR;
+ else if (STRNICMP(attr, "keepscript", len) == 0)
+ *argt |= EX_KEEPSCRIPT;
else if (STRNICMP(attr, "bar", len) == 0)
*argt |= EX_TRLBAR;
else
@@ -1764,13 +1766,17 @@ do_ucmd(exarg_T *eap)
}
}
- current_sctx.sc_version = cmd->uc_script_ctx.sc_version;
+ if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
+ {
+ current_sctx.sc_version = cmd->uc_script_ctx.sc_version;
#ifdef FEAT_EVAL
- current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid;
+ current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid;
#endif
+ }
(void)do_cmdline(buf, eap->getline, eap->cookie,
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
- current_sctx = save_current_sctx;
+ if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
+ current_sctx = save_current_sctx;
vim_free(buf);
vim_free(split_buf);
}