summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErnie Rael <errael@raelity.com>2024-04-02 19:05:39 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-02 19:05:39 +0200
commit16cdfa69e07190674a8e85a48144a467472ca2f4 (patch)
tree5bdb592afd8f78f6e626a2951bbd8e53c593f7d0
parent0a419e07a705675ac159218f42c1daa151d2ceea (diff)
patch 9.1.0255: Vim9: no indication of script nr in stack trace of classesv9.1.0255
Problem: Vim9: no indication of script nr in stack trace of classes Solution: Prefix the class name with the script name in the stack trace. (Ernie Rael) fixes: #14376 closes: #14390 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/scriptfile.c3
-rw-r--r--src/testdir/test_vim9_class.vim2
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c
index 6dc55579a8..109e13e5c6 100644
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -215,6 +215,9 @@ estack_sfile(estack_arg_T which UNUSED)
if (*class_name != NUL)
{
// For class methods prepend "<class name>." to the function name.
+ ga_concat(&ga, (char_u *)"<SNR>");
+ ga.ga_len += vim_snprintf((char *)ga.ga_data + ga.ga_len, 23,
+ "%d_", entry->es_info.ufunc->uf_script_ctx.sc_sid);
ga_concat(&ga, class_name);
ga_append(&ga, '.');
}
diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim
index 0bc3639305..cf900f7630 100644
--- a/src/testdir/test_vim9_class.vim
+++ b/src/testdir/test_vim9_class.vim
@@ -3741,7 +3741,7 @@ def Test_stack_expansion_with_methods()
endclass
def F0()
- assert_match('<SNR>\d\+_F\[1\]\.\.C\.M1\[1\]\.\.<SNR>\d\+_F0\[1\]$', expand('<stack>'))
+ assert_match('<SNR>\d\+_F\[1\]\.\.<SNR>\d\+_C\.M1\[1\]\.\.<SNR>\d\+_F0\[1\]$', expand('<stack>'))
enddef
def F()
diff --git a/src/version.c b/src/version.c
index abb028b6dc..22a1e31a54 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 255,
+/**/
254,
/**/
253,