fix: make diagnostic jumps work again
This commit is contained in:
parent
600306f9be
commit
9da1e94d3a
2 changed files with 6 additions and 3 deletions
|
|
@ -119,6 +119,9 @@ vim.diagnostic.config({
|
|||
},
|
||||
virtual_text = true,
|
||||
virtual_lines = false,
|
||||
jump = {
|
||||
float = true,
|
||||
},
|
||||
-- virtual_lines = {
|
||||
-- current_line = true,
|
||||
-- },
|
||||
|
|
|
|||
|
|
@ -80,19 +80,19 @@ end, { desc = "Format file or range (in visual mode)" })
|
|||
|
||||
-- Go to next diagnostic item (any severity)
|
||||
vim.keymap.set("n", "<leader>da", function()
|
||||
vim.diagnostic.get_next({})
|
||||
vim.diagnostic.jump({ count = 1 })
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next diagnostic" })
|
||||
|
||||
-- Go to next diagnostic item (error severity)
|
||||
vim.keymap.set("n", "<leader>de", function()
|
||||
vim.diagnostic.get_next({ severity = vim.diagnostic.severity.ERROR })
|
||||
vim.diagnostic.jump({ severity = vim.diagnostic.severity.ERROR, count = 1 })
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next error diagnostic" })
|
||||
|
||||
-- Go to next diagnostic item (warning severity)
|
||||
vim.keymap.set("n", "<leader>dw", function()
|
||||
vim.diagnostic.get_next({ severity = vim.diagnostic.severity.WARN })
|
||||
vim.diagnostic.jump({ severity = vim.diagnostic.severity.WARN, count = 1 })
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next warning diagnostic" })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue