-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support word motions for non-ASCII characters #3614
Conversation
🎉 Thanks for your PR. Can you add tests? |
…into nonascii-word-motions
Thanks for taking the time to review this PR! I added a new test suite in |
@@ -108,7 +108,7 @@ export class Position extends vscode.Position { | |||
constructor(line: number, character: number) { | |||
super(line, character); | |||
|
|||
this._nonWordCharRegex = this.makeWordRegex(Position.NonWordCharacters); | |||
this._nonWordCharRegex = this.makeUnicodeWordRegex(Position.NonWordCharacters); |
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.
We don't need to address this on this particular PR, but we should move this initialization elsewhere such that is it statically constructed rather than having to create it over and over again...
What this PR does / why we need it:
This PR provides a better support for word motions (w, b, ...) on non-ASCII characters (#3612).
The updated word motions act similarly to those in the original Vim, which distinguishes the different kinds of symbols such as ideographs, punctuations, and hiraganas, so that sequences of such symbols are treated as separate words. Therefore, cursors on Chinese or Japanese sentences do not jump too far away any more.
Which issue(s) this PR fixes
fixes #3612, fixes #3439.
Special notes for your reviewer: