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.
This commit is contained in:
parent
632f7b06cd
commit
fb05a8e3e6
1 changed files with 2 additions and 1 deletions
3
init.lua
3
init.lua
|
|
@ -672,7 +672,8 @@ require('lazy').setup({
|
|||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('InsertLeave', {
|
||||
vim.api.nvim_create_autocmd('ModeChanged', {
|
||||
pattern = 'i:*',
|
||||
callback = function()
|
||||
set_virtual_text(false)
|
||||
end,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue