0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1297: when a test fails it's often not easy to see where

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.
This commit is contained in:
Bram Moolenaar
2020-07-26 15:37:02 +02:00
parent d66cdcd43a
commit a5d0423fa1
10 changed files with 103 additions and 70 deletions

View File

@@ -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