diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-14 05:18:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-14 05:18:21 +0800 |
commit | 8cd116729fe2a15d62cd10e5ba7d3dcf1f677337 (patch) | |
tree | c3697b80da96e6e1165742979deb121ca491b1d0 /src/nvim/testing.c | |
parent | c1cbe3fb3d2ec1dbcfdc14ee2d9a5e8049d494ae (diff) | |
parent | 1ca2247639424994890ef70ab34f2bffa23ddd9f (diff) | |
download | rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.tar.gz rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.tar.bz2 rneovim-8cd116729fe2a15d62cd10e5ba7d3dcf1f677337.zip |
Merge pull request #19752 from zeertzjq/vim-8.2.0056
vim-patch:8.2.{0056,0061,0078,0097,0823}: execution stack
Diffstat (limited to 'src/nvim/testing.c')
-rw-r--r-- | src/nvim/testing.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/testing.c b/src/nvim/testing.c index 69b687e44f..de6d445ba3 100644 --- a/src/nvim/testing.c +++ b/src/nvim/testing.c @@ -7,6 +7,7 @@ #include "nvim/eval/encode.h" #include "nvim/ex_docmd.h" #include "nvim/os/os.h" +#include "nvim/runtime.h" #include "nvim/testing.h" #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -17,21 +18,23 @@ static void prepare_assert_error(garray_T *gap) { char buf[NUMBUFLEN]; + char *sname = estack_sfile(); ga_init(gap, 1, 100); - if (sourcing_name != NULL) { - ga_concat(gap, (char *)sourcing_name); - if (sourcing_lnum > 0) { + if (sname != NULL) { + ga_concat(gap, sname); + if (SOURCING_LNUM > 0) { ga_concat(gap, " "); } } - if (sourcing_lnum > 0) { - vim_snprintf(buf, ARRAY_SIZE(buf), "line %" PRId64, (int64_t)sourcing_lnum); + if (SOURCING_LNUM > 0) { + vim_snprintf(buf, ARRAY_SIZE(buf), "line %" PRId64, (int64_t)SOURCING_LNUM); ga_concat(gap, buf); } - if (sourcing_name != NULL || sourcing_lnum > 0) { + if (sname != NULL || SOURCING_LNUM > 0) { ga_concat(gap, ": "); } + xfree(sname); } /// Append "p[clen]" to "gap", escaping unprintable characters. |