Repository navigation
Add strict and far-side word part movement actions - #1059
Merged
Merged
Conversation
Word part movement treated `/` and `\` as boundaries only when the token
already contained one, so stopping points depended on the rest of the line:
`Alt+Right` crossed a whole docker tag in one press, while
`this.function('/some/path', parameter2)` still stopped on the `.`.
`moveLeft/RightOneWordPartStrict` treat every ASCII punctuation character,
`/` and `\` included, as a boundary and cross adjacent punctuation in one
press. The `...FarSide` pair crosses a delimiter run to the far edge of the
word instead, so a long docker tag takes roughly half the presses. All four
have an `ExtendSelection` form.
None is bound by default, so `Alt+Arrow` is unchanged. To opt in:
flyline key bind Ctrl+Alt+Left always=moveLeftOneWordPartStrict
flyline key bind Ctrl+Alt+b always=moveLeftOneWordPartFarSide
Tests pin both reported strings in both directions, and the README documents
both families and how to bind them.
Contributor
Author
|
Note, this PR has a lot of comments in it. I'm happy to trim them down if you prefer less comments in the code. Normally I would leave them out but the code is somewhat difficult (for me at least) to understand without the comments so I left them in for now. |
Owner
|
I took the liberty to simplify this PR a bit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1041
Word part movement picks its boundaries from the word under the cursor: if that one word contained a
/or\, only those two characters and whitespace were stopping points, so every other punctuation character (.:-,'()) is treated as part of the word and crossed in one press. Other words on the same line kept splitting at all punctuation. Sothis.function('/some/path', parameter2)jumps fromthis.function('straight to/, and the rest of the quoted path can only be crossed at its slashes, while the trailingparameter2)still splits at its).moveLeft/RightOneWordPartStrictapply one rule to every word: each ASCII punctuation character,/and\included, is a boundary, and a run of adjacent punctuation is crossed in one press (non-ASCII punctuation stays a word character). The...FarSidepair never stops between a punctuation run and the word beyond it: rightward each press lands at the end of the word it crosses, leftward at the start of that same word, so a long docker tag takes roughly half the presses the strict pair needs. All four have anExtendSelectionform.None are bound by default, so
Alt+Arrowis unchanged. To opt in: