~teto


#39 option to use virtualtext when diagnostic fits on the remaining line 1 year, 4 months ago

Ticket created by ~teto on ~whynothugo/lsp_lines.nvim

I love lsp_lines but the way it displaces the content of the text can be annoying which is why if the diagnostic fits on the line as virtual text, I would prefer it to be used and ONLY when the diagnostic is too big, resort to virtual lines.

#4 keep the edited line on the same screen row 2 years ago

Comment by ~teto on ~whynothugo/lsp_lines.nvim

it's already set to false (the default), my remark works regardless of insert mode. if you delete a word, quickly alternate between insert and normal modes, keeping one's eyes on the current row can be tiring (cursorline helps a bit but even better if the eyes don't have to move). It's not easy to implement, just a suggestion. Very cool plugin btw, I love it.

#4 keep the edited line on the same screen row 2 years ago

Ticket created by ~teto on ~whynothugo/lsp_lines.nvim

changing code can sometimes trigger virtual lines that shift the edited line down or up which is hard to keep track of. I wish that the line I am editing stays in the same position regardless of the removed/added virtual lines (maybe add some padding with debouncing for removed lines).

#3 filter by severity 2 years ago

Ticket created by ~teto on ~whynothugo/lsp_lines.nvim

I wish I could filter by severity like I do for virtualtext

vim.diagnostic.config({
  virtual_text = {
	  severity = { min = vim.diagnostic.severity.WARN }
  },
})

Actually maybe lsp_lines could read its filter from the virtual_text one. Right now I've hardcoded the change as:

diff --git a/lua/lsp_lines/init.lua b/lua/lsp_lines/init.lua
index 50a2ff3..c305920 100644
--- a/lua/lsp_lines/init.lua
+++ b/lua/lsp_lines/init.lua
@@ -45,7 +45,9 @@ M.register_lsp_virtual_lines = function()
 
       vim.api.nvim_buf_clear_namespace(bufnr, virt_lines_ns, 0, -1)
 
-      for i, diagnostic in ipairs(diagnostics) do
+	 -- local filter_by_severity = filter_by_severity(
+	 local diagnostics2 = vim.tbl_filter(function(t) return t.severity <= vim.diagnostic.severity.WARN  end, diagnostics)
+      for i, diagnostic in ipairs(diagnostics2) do
         vim.api.nvim_buf_set_extmark(bufnr, virt_lines_ns, diagnostic.lnum, 0, {
           id = i,
           virt_lines = {

to get rid of the annoying hints from pyright