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.
--
Rule #1: Don't give somebody a tool that he's going to hurt himself with.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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/20230225222347.05DDD1C0B1F%40moolenaar.net.