summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-26 15:37:02 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-26 15:37:02 +0200
commita5d0423fa16f18b4576a2a07e50034e489587a7d (patch)
tree67bfe997079bb1a9f17db6a829b29d6369a922a3 /src/ex_docmd.c
parentd66cdcd43a598825add743bc95642cd8ed705252 (diff)
patch 8.2.1297: when a test fails it's often not easy to see wherev8.2.1297
Problem: When a test fails it's often not easy to see what the call stack is. Solution: Add more entries from the call stack in the exception message.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 04c3b465a7..987e92dea9 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8268,8 +8268,10 @@ find_cmdline_var(char_u *src, int *usedlen)
#define SPEC_SFILE (SPEC_CFILE + 1)
"<slnum>", // ":so" file line number
#define SPEC_SLNUM (SPEC_SFILE + 1)
+ "<stack>", // call stack
+#define SPEC_STACK (SPEC_SLNUM + 1)
"<afile>", // autocommand file name
-#define SPEC_AFILE (SPEC_SLNUM + 1)
+#define SPEC_AFILE (SPEC_STACK + 1)
"<abuf>", // autocommand buffer number
#define SPEC_ABUF (SPEC_AFILE + 1)
"<amatch>", // autocommand match name
@@ -8520,10 +8522,13 @@ eval_vars(
break;
case SPEC_SFILE: // file name for ":so" command
- result = estack_sfile();
+ case SPEC_STACK: // call stack
+ result = estack_sfile(spec_idx == SPEC_SFILE);
if (result == NULL)
{
- *errormsg = _("E498: no :source file name to substitute for \"<sfile>\"");
+ *errormsg = spec_idx == SPEC_SFILE
+ ? _("E498: no :source file name to substitute for \"<sfile>\"")
+ : _("E489: no call stack to substitute for \"<stack>\"");
return NULL;
}
resultbuf = result; // remember allocated string