diff src/scriptfile.c @ 34755:1a411f737239 v9.1.0255

patch 9.1.0255: Vim9: no indication of script nr in stack trace of classes Commit: https://github.com/vim/vim/commit/16cdfa69e07190674a8e85a48144a467472ca2f4 Author: Ernie Rael <errael@raelity.com> Date: Tue Apr 2 19:05:39 2024 +0200 patch 9.1.0255: Vim9: no indication of script nr in stack trace of classes 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>
author Christian Brabandt <cb@256bit.org>
date Tue, 02 Apr 2024 19:15:04 +0200
parents a089397c9bc6
children 4cc31827e1db
line wrap: on
line diff
--- 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, '.');
 	    }