fidget.nvim
fidget.nvim copied to clipboard
feat: Add max-width for messages
Particularly when used in combination with java (https://github.com/mfussenegger/nvim-jdtls), a lot of the messages are quite wide - it would be nice to truncate some of these messages so they don't display on top of the code (especially since they appear while typing, not just upon save / load).
For completeness, can you give an example of these messages?
In particular, I'd like to know whether it's the annote or the message field that is too wide.
In 09f0c91d23c3e5939f79c80be2e7bc448d3cbc7d I introduced a new option, render_message, which you can use to truncate messages as you see fit, e.g.,:
render_message = function(msg, cnt)
msg = cnt == 1 and msg or string.format("(%dx) %s", cnt, msg)
msg = vim.fn.strcharpart(msg, 0, 16) -- truncate to 16 characters
return msg
end
Does this suffice? (Admittedly, it does not account for newlines, nor does it do anything about the annote part.)
It's usually the text on the left that is too long (can include URLs, etc.).
I haven't tried a custom formatter yet - I'm a little hesitant to add in-depth custom config myself...