diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-15 10:39:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 10:39:41 +0800 |
commit | a6f0e32d23930b5ab7d5c70d0c58e9964e3af408 (patch) | |
tree | d3b03ad0d09022a99f2adc006881a93ed0ebe670 /src/nvim/ex_docmd.c | |
parent | 1c164689a4ef243be2a0e1b4332c9b6c56b5b031 (diff) | |
parent | 9ab9eb1220113d247dd1eb089cb6576a135b8699 (diff) | |
download | rneovim-a6f0e32d23930b5ab7d5c70d0c58e9964e3af408.tar.gz rneovim-a6f0e32d23930b5ab7d5c70d0c58e9964e3af408.tar.bz2 rneovim-a6f0e32d23930b5ab7d5c70d0c58e9964e3af408.zip |
Merge pull request #19763 from zeertzjq/vim-8.2.1297
vim-patch:8.2.{1297,1653,1658}: expand('<stack>')
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 |