mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2025-10-07 07:22:36 +02:00
fixed error boxes
This commit is contained in:
parent
7254145685
commit
c908421662
@ -272,23 +272,17 @@ cmp.setup({
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = "Go to next diagnostic" })
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic" })
|
||||
|
||||
local diagnostics_auto_enabled = true
|
||||
local diagnostics_autocmd_id = nil
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false, -- Disable virtual text to avoid clutter
|
||||
signs = true, -- Show signs in the gutter
|
||||
underline = true, -- Underline errors
|
||||
update_in_insert = false, -- Don’t update diagnostics in insert mode
|
||||
float = {
|
||||
border = "rounded", -- Optional: nicer border for hover window
|
||||
source = "always", -- Show error source
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
-- Keybinding to toggle diagnostic auto-display
|
||||
vim.keymap.set('n', '<leader>e', toggle_diagnostics_auto, { desc = "Toggle diagnostic auto-display" })
|
||||
|
||||
-- Optional: Manual trigger to show diagnostics immediately
|
||||
vim.keymap.set('n', '<leader>E', vim.diagnostic.open_float, { desc = "Show diagnostic under cursor" })
|
||||
-- Automatically show diagnostics on hover
|
||||
vim.o.updatetime = 250 -- Adjust delay for hover (in milliseconds)
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = function()
|
||||
vim.diagnostic.open_float(nil, { focusable = false })
|
||||
end,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user