Skip to content

Commit

Permalink
feat(lsp_lines-nvim): disable virtual text and add <leader>uD mappi…
Browse files Browse the repository at this point in the history
…ng (#411)

* fix(lsp_lines-nvim): duplicate diagnostics

This should be later improved by silencing the notification

* chore(lsp_lines.nvim): add `<leader>uD` mapping

Ideally this would be impemented as one of the cycled options in `<leader>ud` (aka astronvim.ui.toggle_diagnostics)

* fix(lsp_lines-nvim): remove startup notification

Co-authored-by: Micah Halter <[email protected]>

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
TheSast and mehalter authored Jul 12, 2023
1 parent 1e63a40 commit 4de6948
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lua/astrocommunity/diagnostics/lsp_lines-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
return { "https://git.sr.ht/~whynothugo/lsp_lines.nvim", event = "LspAttach", opts = {} }
return {
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
keys = {
{
"<Leader>uD",
function()
vim.diagnostic.config {
virtual_text = not require("lsp_lines").toggle(),
}
end,
desc = "Toggle virtual diagnostic lines",
},
},
opts = {},
config = function(_, opts)
-- disable diagnostic virtual text
local lsp_utils = require "astronvim.utils.lsp"
lsp_utils.diagnostics[3].virtual_text = false
vim.diagnostic.config(lsp_utils.diagnostics[vim.g.diagnostics_mode])
require("lsp_lines").setup(opts)
end,
}

0 comments on commit 4de6948

Please sign in to comment.