On 23/02/25 2:23 PM, Bram Moolenaar wrote:
Ernie Rael wrote:
I'm playing around with putting a stacktrace in a log file. I probably
want to include the script file name. Example stacktrace is
<SNR>31_Baz[1]
<SNR>31_Bar[1]
function <SNR>31_Foo[1]
script /home/err/play/xxx.vim[27]
I tried
expand("<SNR>31")
I see ":scriptnames", and I just found scriptnames-dictionary, so I
guess that's the route to take. I suppose if I encounter a <SNR> that's
not in cached dictionary, I should run it again. Unless of course
there's some builtin support since scriptnames-dictionary was written
that I can't find.
Is a patch to eval.txt of interest to use a vim9 function instead?
There actually is getscriptinfo(). Have a look at it, parsing the
output of :scriptnames might not be needed.
I'll mention getscriptinfo() in a couple of places, it is not so easy to
find.
Thanks, perfect. Update PR#12062 to use getscriptinfo().
-ernie
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/f3cca812-f58b-80dc-f3cd-4a0041e1bc01%40raelity.com.