This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
Fix includeNonWordCharacters regression in Cursor #16544
Merged
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.
Description of the Change
43aa3c7 (#15776) broke
includeNonWordCharacters
functionality ofCursor#getBeginningOfCurrentWordBufferPosition
andCursor#getEndOfCurrentWordBufferPosition
. I fixed that regression.NOTE: There are no tests here. There are no tests of
Cursor
that I can see. I would be happy to add some tests to cover theincludeNonWordCharacters
functionality, but I could use some guidance (or an example?) on how to use/clean up after usingatom.workspace
, etc.Alternate Designs
Alternate designs would require needless refactoring. I just made the call to
#wordRegExp
look like it did before (i.e., it should be passedoptions
).Why Should This Be In Core?
It was broken in core.
Benefits
The regression of
includeNonWordCharacters
functionality will be resolved.Possible Drawbacks
I don't see any possible drawbacks of the change.
Verification Process
I used sublime-word-navigation to verify that the bug was fixed. That package uses
includeNonWordCharacters
for both beginning and end of word movement. With that package installed, I:foo-bar-baz-qux
into a bufferfoo-bar-baz-qux|
Without this fix in place, the cursor is after baz:
foo-bar-baz|-qux
With this fix in place (and in Atom < 1.23.0), the cursor is in front of baz:
foo-bar-|baz-qux
I did not verify that this change doesn't introduce any regressions. I am reverting a call back to what it was previously (passing in
options
), so I'm not very worried about regressions.Applicable Issues
None