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

add move_prev_long_word_end and extend_prev_long_word_end commands #6905

Merged
merged 4 commits into from
Jun 7, 2023
Merged

add move_prev_long_word_end and extend_prev_long_word_end commands #6905

merged 4 commits into from
Jun 7, 2023

Conversation

vwkd
Copy link
Contributor

@vwkd vwkd commented Apr 28, 2023

Fixes #6904

Adds the move_prev_long_word_end and extend_prev_long_word_end commands.

Tests are adapted from test_behaviour_when_moving_to_start_of_previous_long_words of the move_prev_long_word_start command, please double check if these are correct.

Here's a quick config to test the new commands with the keybinding A-W, together with A-w for the already existing but by default unbound move_prev_word_end.

[keys.normal]
A-w = "move_prev_word_end"
A-W = "move_prev_long_word_end"

[keys.select]
A-w = "extend_prev_word_end"
A-W = "extend_prev_long_word_end"

@vwkd vwkd marked this pull request as draft April 28, 2023 10:07
Comment on lines +180 to +183
pub fn move_prev_word_end(slice: RopeSlice, range: Range, count: usize) -> Range {
word_move(slice, range, count, WordMotionTarget::PrevWordEnd)
}

Copy link
Contributor Author

@vwkd vwkd Apr 28, 2023

Choose a reason for hiding this comment

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

This just moved up from below where it was out of sequence.

Comment on lines +1462 to +1464
("Starting from after boundary retreats the anchor",
vec![(1, Range::new(0, 9), Range::new(8, 0))],
),
Copy link
Contributor Author

@vwkd vwkd Apr 28, 2023

Choose a reason for hiding this comment

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

This was commented out in test_behaviour_when_moving_to_start_of_previous_long_words but seems to be passing here so I added it back.

@vwkd vwkd marked this pull request as ready for review April 28, 2023 13:58
@pascalkuthe pascalkuthe merged commit 352d157 into helix-editor:master Jun 7, 2023
@vwkd vwkd deleted the prev_long_word_end branch June 8, 2023 00:53
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add move_prev_long_word_end command
3 participants