]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0255: Vim9: no indication of script nr in stack trace of classes v9.1.0255
authorErnie Rael <errael@raelity.com>
Tue, 2 Apr 2024 17:05:39 +0000 (19:05 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 2 Apr 2024 17:05:39 +0000 (19:05 +0200)
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>
src/scriptfile.c
src/testdir/test_vim9_class.vim
src/version.c

index 6dc55579a8c2463c743a938a9c7c9d401c49fe40..109e13e5c602e54c21e430a15822e54354469d5b 100644 (file)
@@ -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, '.');
            }
index 0bc36393057dc186bc7d118a2bf61adff6e3f231..cf900f76300335b9389509418b2b42854a1323bb 100644 (file)
@@ -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()
index abb028b6dc430821e6ef78ee8a05d9aa5306ea2f..22a1e31a5471ece0e4098fff25646259368e5c3b 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    255,
 /**/
     254,
 /**/