helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.48k stars 2.48k forks source link

Scrolling loses primary selection #2520

Open aral opened 2 years ago

aral commented 2 years ago

Summary

Make a selection or two and scroll (e.g., to see if there are any others you want to add to your multiple selection). Helix loses your primary selection as you approach the top of the screen.

Reproduction Steps

  1. Make one or more selections
  2. Scroll the viewport using the mouse wheel or using sticky view navigation, etc.

What should happen

All your selections should stay as they are. You haven’t expressed a desire to change those in any way. You just want to see a different part of your code.

What actually happens

Your primary selection is lost.

Helix log

n/a

Platform

Linux (Fedora Silverblue 36)

Terminal Emulator

GNOME Console

Helix Version

helix 22.05-dev (3a398eec)

the-mikedavis commented 2 years ago

I see selections being retained when looking around in sticky view mode (Z) or with C-f/C-b and with thrackpad or mouse-wheel scrolling: https://asciinema.org/a/496073

aral commented 2 years ago

@the-mikedavis Thanks for looking into this. At around 0:07, the primary selection disappears. I just checked again, and yes, the secondary selections stay intact. Will update the issue to reflect this now.

the-mikedavis commented 2 years ago

Oh yeah I see that now too. The selection counter stays the same when the primary selection disappears but the primary cursor moves to stay within view which moves that selection. If you replace/change the selections after that it makes a change where the primary cursor moved instead of the original selection. I think this is ultimately https://github.com/helix-editor/helix/issues/2134