kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.18k stars 38 forks source link

Make error messages easy to see when something goes wrong #79

Closed wookayin closed 1 year ago

wookayin commented 1 year ago

Feature description

When something goes wrong (i.e., users have a mistake or error thrown in their custom virtual_text_handler), virtual text will not work but an error message will be displayed.

nvim-ufo error cases

Often the case the error message remains not disappeared, but in combination with other plugins which causes redraw of the screen the error message from nvim-ufo in the virtual text region can disappear and flicker as the cursor is moved. (Note: even if I don't move cursors, I still cannot read the message because it will be gone in the next tick of redrawing) It's also quite difficult to see the error messages because they are trimmed at right.

Describe the solution you'd like

It'd be great if there's way to collect such errors and look at those more easily. For example, we can have something like :UfoInfo where all the detailed error message and stacktrace are printed. Or, we can simply have the error messages collected to :messages history (e.g. lua print or echom). Any other ways would be good, as long as it's helpful for informing users where the exception is thrown from.

Additional context

-

kevinhwang91 commented 1 year ago

Make sense. image

wookayin commented 1 year ago

Perfect, it works exactly as shown in the screenshot and there's no flickering. Thanks!

xuanhung1509 commented 1 year ago

In my case, the error messages are not fully display and still flick on moving up/down

https://github.com/kevinhwang91/nvim-ufo/assets/89293664/6fe80f45-4a79-4e53-a42f-875fe7044e3b

kevinhwang91 commented 1 year ago

Not related to this issue. Look like lazy load ufo and buffer is not attached. BTW, don't comment this issue anymore.