helix icon indicating copy to clipboard operation
helix copied to clipboard

Long inlay hints combined with soft wrap sometimes block moving up

Open AverageLinuxEnjoyer opened this issue 7 months ago • 4 comments

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).

  1. have rust-analyzer or nix installed
  2. clone this repo https://github.com/AverageLinuxEnjoyer/helix-bug-repo (contains the code in the video)
  3. nix develop -c $SHELL if you have nix, but not rust-analyzer
  4. cargo build to get chumsky (the crate in Cargo.toml) installed
  5. hx into the project
  6. enable inlay hints and soft wrap if not enabled
[editor.lsp]
display-inlay-hints = true

[editor.soft-wrap]
enable=true
  1. 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

AverageLinuxEnjoyer avatar Jan 03 '24 12:01 AverageLinuxEnjoyer

I don't think this was reported before so it's likely still an issue, but I'd recommend upgrading to 23.10 anyway.

kirawi avatar Jan 03 '24 22:01 kirawi

I'm facing the same issue on latest version 2d15acdf6029fd9b418bf4797c2947d6004dddbd.

ivq avatar Mar 12 '24 13:03 ivq

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).

kirawi avatar Mar 31 '24 13:03 kirawi

Like I said in #9287 this will be addressed in #6417. These kinds of changes to the positioning system are highly interrelated

pascalkuthe avatar Mar 31 '24 13:03 pascalkuthe