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

Implement Kakoune's A-S: Select first and last chars #9483

Closed

Conversation

ghost
Copy link

@ghost ghost commented Jan 30, 2024

Fixes #9459

@ghost ghost mentioned this pull request Jan 30, 2024
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Jan 30, 2024
@ghost ghost changed the title Select first and last chars Implement Kakoune's A-S: Select first and last chars Jan 30, 2024
@ghost ghost changed the title Implement Kakoune's A-S: Select first and last chars Implement Kakoune's A-S: Select first and last chars Jan 30, 2024
@kirawi
Copy link
Member

kirawi commented Jan 30, 2024

I don't think this handles zero-size selections (only when doc is completely empty) or 1-wide selections. Might want to check the size first.

@ghost
Copy link
Author

ghost commented Jan 30, 2024

I don't think this handles zero-size selections (only when doc is completely empty) or 1-wide selections. Might want to check the size first.

Good catch - I'll do that now

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be added to the book under selection manipulation: https://github.com/helix-editor/helix/blob/master/book/src/keymap.md#selection-manipulation

helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Jan 30, 2024

Okay just made the fixes. I believe that using the helpers also addressed the overflow issues that @kirawi mentioned.

helix-term/src/commands.rs Outdated Show resolved Hide resolved
book/src/keymap.md Outdated Show resolved Hide resolved
Axlefublr added a commit to Axlefublr/helix that referenced this pull request Nov 30, 2024
Added kakoune's A-S command

Small formatting change

Updated to use grapheme helpers

Change to Range::point and fix keymap formatting
@ghost ghost closed this by deleting the head repository Dec 15, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Kakoune's A-S
2 participants