[X] You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
lsp-lens-mode appears to change the way the cursor is placed on certain lines. This only occurs for lines which are preceded by a multi-line Lens. I have provided one example of the bug and three non-examples.
Without knowing anything about how Lenses are rendered, I'm guessing this happens because a multi-line Lens occupies the position of a character.
I suspect this is a limitation of Emacs and cannot be improved.
Thank you
Non-exampleM-x goto-line 31: the cursor is placed correctly
Another non-exampleM-x goto-line 32: again, the cursor is placed correctly
ExampleM-x goto-line 33: the cursor is placed at the top of the lens belonging to line 32. Emacs thinks this position is Line 33, Column 0.
Clicking on line 33, column 0 also places the cursor in that incorrect position.
But clicking on line 33, column 1 places the cursor correctly:
Another non-exampleM-x goto-line 35: the cursor is placed correctly. This shows that lines which are not preceded by a multi-line lens are unaffected.
These were produced with lsp-start-plain.
Steps to reproduce
Use display-line-numbers-mode and lsp-lens-mode. Begin an LSP session which has multi-line Lenses.
M-x goto-line to a line that follows a multi-line lens.
Or click on the first character of a line that follows a multi-line lens.
I'm seeing this issue, too, and I'll add that multi-line code lenses break scrolling completely: scrolling with the mouse, or scrolling with the keyboard (pgup / pgdown).
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
lsp-lens-mode
appears to change the way the cursor is placed on certain lines. This only occurs for lines which are preceded by a multi-line Lens. I have provided one example of the bug and three non-examples.Without knowing anything about how Lenses are rendered, I'm guessing this happens because a multi-line Lens occupies the position of a character.
I suspect this is a limitation of Emacs and cannot be improved.
Thank you
Non-example
M-x goto-line 31
: the cursor is placed correctlyAnother non-example
M-x goto-line 32
: again, the cursor is placed correctlyExample
M-x goto-line 33
: the cursor is placed at the top of the lens belonging to line 32. Emacs thinks this position is Line 33, Column 0.Clicking on line 33, column 0 also places the cursor in that incorrect position. But clicking on line 33, column 1 places the cursor correctly:
Another non-example
M-x goto-line 35
: the cursor is placed correctly. This shows that lines which are not preceded by a multi-line lens are unaffected.These were produced with
lsp-start-plain
.Steps to reproduce
Use
display-line-numbers-mode
andlsp-lens-mode
. Begin an LSP session which has multi-line Lenses.M-x goto-line
to a line that follows a multi-line lens. Or click on the first character of a line that follows a multi-line lens.This file is one example: https://github.com/peterbecich/servant-ekg/blob/6dc27930c34f38ee391a1d4d57dc436438abddd0/lib/Servant/Ekg.hs#L30
Expected behavior
I think the placement of the cursor should match the line numbers on the fringe.
Which Language Server did you use?
lsp-haskell
and Haskell Language Server installed with ghcup https://www.haskell.org/ghcup/OS
Linux
Error callstack
No response
Anything else?
lsp-mode
20220124.1546