diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5ea6a224d6..de62d90610 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7719,6 +7719,7 @@ ssize_t find_cmdline_var(const char_u *src, size_t *usedlen) /// '<cexpr>' to C-expression under the cursor /// '<cfile>' to path name under the cursor /// '<sfile>' to sourced file name +/// '<stack>' to call stack /// '<slnum>' to sourced file line number /// '<afile>' to file name for autocommand /// '<abuf>' to buffer number for autocommand @@ -7912,9 +7913,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 ? ESTACK_SFILE : ESTACK_STACK); 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 |