45 lines
954 B
Lua
45 lines
954 B
Lua
|
local function close_floats()
|
||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||
|
if vim.api.nvim_win_get_config(win).relative == "win" then
|
||
|
vim.api.nvim_win_close(win, false)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return {
|
||
|
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||
|
commit = 'a92c755f182b89ea91bd8a6a2227208026f27b4d',
|
||
|
lazy = false,
|
||
|
|
||
|
keys = {
|
||
|
{
|
||
|
'<leader>df',
|
||
|
function()
|
||
|
require("lsp_lines").toggle()
|
||
|
|
||
|
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,
|
||
|
|
||
|
opts = {}
|
||
|
}
|