Compatibility with lazy.nvim

With lazy.nvim, it'll show both lsp_lines, as well as the default diagnostic when I run :Lazy, even if I turn the default diagnostic off.

If I require('lsp_lines').toggle(), both will go away... and if I toggle again, only the lsp_lines one will come back.

I'm wondering if there's a way to ONLY have the default virtual text show up, as it makes sense for it to be on the right of the text in this context only. I think simply disabling lsp_lines for this filetype would work out well for this case.

Assigned to
11 months ago
8 months ago
No labels applied.

~whynothugo 11 months ago

I don't think lazy.nvim is related to your issue.

Both diagnostics will render unless you explicitly disable one of them. This is covered in the README:


~hwrd 11 months ago

I understand, and it is specifically lazy.nvim

I have my regular buffers configured properly and it's really beautiful. Really love your plugin.

But in lazy, I just need to disable the virtual_lines.

~hwrd 11 months ago

This is my diagnostic config:

      update_in_insert = false,
      signs = false,
      severity_sort = true,
      virtual_text = false, -- Since we're using lsp_lines
      virtual_lines = true,

And here is what a file with diagnostics looks like to me, compared to :Lazy after running sync: https://imgur.com/a/fMZYf39

I'm not sure why Lazy is showing both, and why it's showing it as diagnostics as opposed to just virtual text... but I prefer not having lsp_lines for just :Lazy.

~agoodshort 9 months ago

This is caused by the way lazy.nvim forces to display virtual_text. Here is a detailed explanation and a workaround to fix this issue.

For the lazy out there, here is the workaround (I personally added it in my plugin config function):

-- https://github.com/folke/lazy.nvim/issues/620
vim.diagnostic.config({ virtual_lines = false }, require("lazy.core.config").ns)

Though I think, the best way to fix such issue (and any similar behaviour) would be to implement a way to disable lsp_lines.nvim for certain filetypes: ~whynothugo/lsp_lines.nvim#23

~hwrd 9 months ago

Thank you for the workaround. I read through the issue for lazy.nvim and I fully agree that the best way to fix this issue would be a filetype exclusion list.

~whynothugo REPORTED NOT_OUR_BUG 8 months ago

Register here or Log in to comment, or comment via email.