feat: Hook `vim.print` in the same way as `print` is hooked
Closed this issue · 3 comments
Approximately: `vim.print(x) <=> print(vim.inspect(x))
its quite useful for printing tables.
we may want to use virtual lines rather than eol virtual text for this since it can often be multiline
Hi @IndianBoy42
The print
function provided by this plugin already uses vim.inspect
internally, there is no need for doing print(vim.inspect(x))
. This would only mess the result. And the vim.print
was left intensionally, because someone may want to print something in the standard way without virtual text.
Does your print give a different result? If so, then something is wrong, and I will need more information to diagnose the problem.
Regarding virtual lines, that sounds interesting. Would you see this as an alternative to the current preview window?
I'll do some tests to see how it works out.
Wow, I don't know how I skipped over that print does print tables, sorry about that
Regarding virtual lines, that sounds interesting. Would you see this as an alternative to the current preview window?
I think it could be, its basically the same but inline so maybe could be kept persistent. Or have a keybinding that switches the virtual text from eol to lines.
Actually I could try and implement it myself, always like hacking on plugins in my free time so if this isn't a priority for you than I'll work on it and submit a PR
No problem :)
Actually I could try and implement it myself
If you want, then sure! Any contribution are welcome! <3 If you have any questions, don't hesitate to ask. You can open even empty PR (marked as draft) for them.
The first problem worth thinking about is displaying multiple calls (function calls, loops). This can be a bit unreadable with multi-line results.