vim-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.
a5d0423fa1

Use docs from latest Vim.
This commit is contained in:
zeertzjq
2022-08-14 06:32:00 +08:00
parent 1c164689a4
commit 98ab0bb5f7
9 changed files with 77 additions and 43 deletions

View File

@@ -7912,9 +7912,12 @@ char_u *eval_vars(char_u *src, char_u *srcstart, size_t *usedlen, linenr_T *lnum
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