Skip to content

Commit fb05a8e

Browse files
committed
feat(diagnostics): emulate VSCode Error Lens with virtual text and lines
Added functionality to mimic VSCode's Error Lens behavior: - Displays diagnostics as virtual text with severity icons during insert mode. - Switches to virtual lines with formatted messages in normal mode for better readability. - Replaced `InsertLeave` with `ModeChanged` (`i:*`) to ensure diagnostics update correctly even when exiting insert> This refactor improves code readability, follows single-responsibility principles, and makes it easier to maintain > Improves real-time feedback while coding and enhances the visual presentation of diagnostics.
1 parent 632f7b0 commit fb05a8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ require('lazy').setup({
672672
end,
673673
})
674674

675-
vim.api.nvim_create_autocmd('InsertLeave', {
675+
vim.api.nvim_create_autocmd('ModeChanged', {
676+
pattern = 'i:*',
676677
callback = function()
677678
set_virtual_text(false)
678679
end,

0 commit comments

Comments
 (0)