~andrewferrier


#16 Diagnostics don't appear on last line 2 years ago

Comment by ~andrewferrier on ~whynothugo/lsp_lines.nvim

Issue raised: https://github.com/neovim/neovim/issues/19605 . Obviously feel free to contribute.

#16 Diagnostics don't appear on last line 2 years ago

Comment by ~andrewferrier on ~whynothugo/lsp_lines.nvim

OK, I'll open a bug upstream to test the waters for whether this is considered an issue. Will post the link back here once done.

#16 Diagnostics don't appear on last line 2 years ago

Comment by ~andrewferrier on ~whynothugo/lsp_lines.nvim

nvim itself.

I think I've found the problem. It looks like virtual lines are not treated as lines that can be scrolled to. For example, assume a relatively long file; longer than the screen. Create a diagnostic (e.g. syntax error) on the last line, just like in your example. Scroll to the top of the file, then scroll to the bottom again using the G key. The scrolling stops on the last line and you cannot see the diagnostic. Even pressing <Down> does not display the diagnostic.

Now, scroll via half-pages instead by pressing Ctrl-F. Now the diagnostic is visible.

So there is a workaround here, albeit one which isn't immediately obvious (because you have to know the diagnostic is there, presumably via some other method like signs, which you might not being using). Personally I don't scroll using Ctrl-F much, maybe some other people do.

I'm not sure what the right fix is here. Maybe the NeoVim developers didn't envisage virtual lines below the bottom line, although obviously it does support them. I understand why they would need to be treated differently from 'real' buffer lines, and why scrolling stops where it does, but it is confusing. Maybe the right approach would be for the screen to continue to scroll until all virtual lines are shown, but for the cursor not to move.

What are you thinking? Is there a bug to raise against NeoVim here?

#16 Diagnostics don't appear on last line 2 years ago

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

I find that diagnostics don't appear using lsp_lines if they are on the last line of a file. Signs and virtual text still appear, but not the lsp_lines diagnostics. Adding even just an empty/blank line to the end of the file is enough to then trigger them to display.

NeoVim 0.7.2 on Mac, lsp_lines commit db67e94c813

#14 Since commit 86df32, lots of errors 2 years ago

Comment by ~andrewferrier on ~whynothugo/lsp_lines.nvim

Perfect, thanks this seems to be resolved!

#14 Since commit 86df32, lots of errors 2 years ago

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

lsp_lines was working well, but since commit 86df32, I've started seeing lots of errors from lsp_lines.nvim.

Recreation:

  • Open a markdown file
  • Enter insert mode, make some changes
  • Hit to leave insert mode
  • See the following error:
Error executing vim.schedule lua callback: ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:14: The coroutine failed with this mess
age: ...ack/packer/start/lsp_lines.nvim/lua/lsp_lines/render.lua:200: Invalid buffer id: 17
stack traceback:
        [C]: in function 'error'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:14: in function 'callback_or_next'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:40: in function <...ck/packer/start/plenary.nvim/lua/plenary/async/async.l
ua:39>

Reverting to the previous commit (22ef87c6b2039a) resolves the issue.

I can try and create a minimal vimrc if you can't recreate.

I am not using coc, but in-built LSP+null-ls.

Thanks for your hard work on this great plugin!