-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
adds movement for start of word, regardless of stop characters #6445
base: main
Are you sure you want to change the base?
Conversation
Sample test/with-characters that cause stopps -(cursor) -(after hitting MoveBackwardWordStart)
it's missing documentation, I just wanted to get some feedback if this is the proper way to implement the new movement. |
About naming, I think Also, instead of basically re-implementing |
Naming is always hard, I thought it would fit well with "moveForwardEnd" > "BackwardStart". In terms of code, I took the easy way, not wanting to have to deal with breaking changes and refactoring. But I can give it a refactor, need to look into the test-cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Please also add a page to the docs for the new action; look at docs/config/lua/keyassignment/CopyMode/MoveForwardWordEnd.md
for inspiration!
@@ -672,6 +672,7 @@ pub enum CopyModeAssignment { | |||
MoveToStartOfNextLine, | |||
MoveToSelectionOtherEnd, | |||
MoveToSelectionOtherEndHoriz, | |||
MoveBackwardWordStart, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I think this name is probably about as good as it's going to get; it is consistent with MoveForwardWordEnd
and it does describe what it does reasonably well.
@@ -822,6 +822,54 @@ impl CopyRenderable { | |||
} | |||
} | |||
|
|||
fn move_backward_one_word_start(&mut self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to tell at a glance just how similar this is to the move_backward_one_word
function. If adding a parameter to control whether it should be in "start mode" or not makes for a smaller diff and a more readable function, that would get my vote!
regarding #195 #1954 (comment)