helix
helix copied to clipboard
Long inlay hints combined with soft wrap sometimes block moving up
Summary
The k key (to move up) sometimes does nothing when I'm encountering an inlay hint that spans over multiple lines.
Here's the video. In the first half moving down and up works. In the second half (after I open the second terminal), moving down always works but moving up sometimes doesn't. When I highlight a line it means I'm blocked.
https://github.com/helix-editor/helix/assets/91616580/99eb74ae-c6cf-4e7b-b060-1aee72d12bb3
Reproduction Steps
I haven't been able to easily get long types that reproduce the problem so instead of creating a minimal example I'll just give you my project, which is small anyway (1 code file).
- have rust-analyzer or nix installed
- clone this repo https://github.com/AverageLinuxEnjoyer/helix-bug-repo (contains the code in the video)
-
nix develop -c $SHELL
if you have nix, but not rust-analyzer -
cargo build
to getchumsky
(the crate in Cargo.toml) installed -
hx
into the project - enable inlay hints and soft wrap if not enabled
[editor.lsp]
display-inlay-hints = true
[editor.soft-wrap]
enable=true
- try scrolling up and down in
main.rs
like I did with various terminal sizes
I expected this to happen: To be able to move up unconditionally.
Instead, this happened: I'm sometimes blocked and can't move up.
Helix log
~/.cache/helix/helix.log
There's no change in logs for this bug.
Platform
Linux
Terminal Emulator
kitty 0.28.1
Installation Method
nixpkgs
Helix Version
helix 23.05
I don't think this was reported before so it's likely still an issue, but I'd recommend upgrading to 23.10 anyway.
I'm facing the same issue on latest version 2d15acdf6029fd9b418bf4797c2947d6004dddbd.
The relevant function is defined in https://github.com/helix-editor/helix/blob/2f4572d91e5846f2b300c9292c5b446474c5fe52/helix-core/src/movement.rs#L55-L104
The code to resolve this issue might also resolve // TODO how to handle inline annotations that span an entire visual line (very unlikely).
Like I said in #9287 this will be addressed in #6417. These kinds of changes to the positioning system are highly interrelated