2025-02-12 11:49:02 +01:00
|
|
|
local function close_floats()
|
|
|
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
2025-02-13 09:04:17 +01:00
|
|
|
if vim.api.nvim_win_get_config(win).relative == 'win' then
|
2025-02-12 11:49:02 +01:00
|
|
|
vim.api.nvim_win_close(win, false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
2025-02-13 09:04:17 +01:00
|
|
|
'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
|
2025-02-12 11:49:02 +01:00
|
|
|
commit = 'a92c755f182b89ea91bd8a6a2227208026f27b4d',
|
|
|
|
lazy = false,
|
|
|
|
|
|
|
|
keys = {
|
|
|
|
{
|
|
|
|
'<leader>df',
|
|
|
|
function()
|
2025-02-13 09:04:17 +01:00
|
|
|
require('lsp_lines').toggle()
|
2025-02-12 11:49:02 +01:00
|
|
|
|
|
|
|
if vim.diagnostic.config().virtual_lines then
|
|
|
|
close_floats()
|
|
|
|
else
|
|
|
|
vim.diagnostic.open_float()
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
desc = 'Toggle [D]ebug [L]ines',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'<Esc>',
|
|
|
|
function()
|
|
|
|
close_floats()
|
|
|
|
end,
|
|
|
|
desc = 'Close [F]loats',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
init = function()
|
|
|
|
vim.diagnostic.config({ virtual_text = false })
|
|
|
|
--vim.diagnostic.config({ virtual_text = false, virtual_lines = { only_current_line = true } })
|
|
|
|
--vim.diagnostic.config({ virtual_text = false, virtual_lines = { only_current_line = true }, })
|
|
|
|
end,
|
|
|
|
|
2025-02-13 09:04:17 +01:00
|
|
|
opts = {},
|
2025-02-12 11:49:02 +01:00
|
|
|
}
|