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_text = true,
|
||||||
virtual_lines = false,
|
virtual_lines = false,
|
||||||
|
jump = {
|
||||||
|
float = true,
|
||||||
|
},
|
||||||
-- virtual_lines = {
|
-- virtual_lines = {
|
||||||
-- current_line = true,
|
-- current_line = true,
|
||||||
-- },
|
-- },
|
||||||
|
|
|
||||||
|
|
@ -80,19 +80,19 @@ end, { desc = "Format file or range (in visual mode)" })
|
||||||
|
|
||||||
-- Go to next diagnostic item (any severity)
|
-- Go to next diagnostic item (any severity)
|
||||||
vim.keymap.set("n", "<leader>da", function()
|
vim.keymap.set("n", "<leader>da", function()
|
||||||
vim.diagnostic.get_next({})
|
vim.diagnostic.jump({ count = 1 })
|
||||||
vim.api.nvim_feedkeys("zz", "n", false)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end, { desc = "Go to next diagnostic" })
|
end, { desc = "Go to next diagnostic" })
|
||||||
|
|
||||||
-- Go to next diagnostic item (error severity)
|
-- Go to next diagnostic item (error severity)
|
||||||
vim.keymap.set("n", "<leader>de", function()
|
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)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end, { desc = "Go to next error diagnostic" })
|
end, { desc = "Go to next error diagnostic" })
|
||||||
|
|
||||||
-- Go to next diagnostic item (warning severity)
|
-- Go to next diagnostic item (warning severity)
|
||||||
vim.keymap.set("n", "<leader>dw", function()
|
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)
|
vim.api.nvim_feedkeys("zz", "n", false)
|
||||||
end, { desc = "Go to next warning diagnostic" })
|
end, { desc = "Go to next warning diagnostic" })
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue