Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"C" + "," keeps only the last selection #5760

Closed
tcoratger opened this issue Feb 1, 2023 · 4 comments · Fixed by #10465
Closed

"C" + "," keeps only the last selection #5760

tcoratger opened this issue Feb 1, 2023 · 4 comments · Fixed by #10465
Labels
A-documentation Area: Documentation improvements C-bug Category: This is a bug

Comments

@tcoratger
Copy link

Summary

3"C" (Copy selection onto the next line (Add cursor below)) + "," (Keep only the primary selection) results in keeping only the last selection.

Reproduction Steps

No response

Helix log

No response

Platform

macOS

Terminal Emulator

Warp

Helix Version

hx -V

@tcoratger tcoratger added the C-bug Category: This is a bug label Feb 1, 2023
@CptPotato
Copy link
Contributor

CptPotato commented Feb 1, 2023

, is actually behaving correctly. When using C the newly inserted cursor becomes the primary (the lightest cursor is the primary in the screenshot):

image

If you want to keep a specific selection you can "rotate" your selections using ( and ) before discarding the secondary ones.

@tcoratger
Copy link
Author

But horizontally, it behaves differently:

  • x to select the whole line

  • s to search an item inside (test in my case)

  • I obtain different cursors (2 in my case)

  • If I press , only the first persists
    Capture d’écran 2023-02-01 à 10 45 46

  • Following this, I was expecting the same behaviour vertically
    Capture d’écran 2023-02-01 à 10 48 34

@CptPotato
Copy link
Contributor

Right, the tutor makes it sound like it should work the other way around.

I'm not sure if this is the intended behavior of C, I personally don't have a strong preference here. Maybe somebody else can chime in?

@the-mikedavis
Copy link
Member

Yep this behavior of C is intentional and it matches Kakoune. C adds a new selection based on the location of the primary selection. If C didn't make the new selection the primary selection then C would only work once.

The tutor should be updated to say that the first cursor will be removed, here:

4. Type , to remove the second cursor.

C and s are not really related and they behave very differently already when you have multiple selections: C adds a new selection and keeps the current selections unchanged while s subsplits all existing selections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants