Open gepbird opened 3 weeks ago
Hi @gepbird just got round to this. I'd be up for an optional change to redraw the tabline when using diagnostic handlers. Personally I've never had an issue with this but seems valuable as an option
Thanks for your response! I'll submit a PR soon with an option called diagnostic_update_on_event
. I used a hacked-in version of the proposed change since I opened this issue and had no problems with it.
Is there an existing issue for this?
What happened?
Bufferline doesn't update when diagnostics change, it can say there are errors when there aren't or vice versa. This is very annoying when using an lsp formatter to fix style errors and seeing that bufferline reports there are still errors (are those actual errors or those errors are outdated? I have to update bufferline to find it out).
With this minimal config, when I delete the erroneous line with
dd
, bufferline still shows the warning until I update it with:
.https://github.com/akinsho/bufferline.nvim/assets/29818440/72abd30e-c4e5-4837-89de-8fc0b26faa3a
What did you expect to happen?
Bufferline also updates when diagnostics changes.
Config
Additional Information
Setting
options.diagnostics_update_in_insert = true
for bufferline doesn't solve this issue.After debugging this issue, I found out that neovim doesn't refresh the tabline when diagnostics change. Bufferline could refresh it, see
:h diagnostic-handlers
. This would makediagnostic_update_in_insert
deprecated if it was trying to fix this kind of issue. But ifdiagnostic_update_in_insert
was introduced to allow reducing tabline redraws, we could introduce an option likediagnostic_update_on_change
. Please let me know which solution we should go with, I'd be happy to make a PR!commit
https://github.com/akinsho/bufferline.nvim/commit/99337f63f0a3c3ab9519f3d1da7618ca4f91cffe