-
-
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
Fix word separation #3667
Fix word separation #3667
Conversation
Thanks to the issue report #3680, it was found that Latin-1 symbols and punctuations were wrongly classified as word characters. I overlooked that the original Vim treats characters whose code point is less than This PR fixes #3680. |
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.
One minor comment, but generally LGTM.
src/common/motion/position.ts
Outdated
// Spelling alphabets are not listed here since they are covered as non-white letters. | ||
// TODO(ajalab): add Emoji | ||
const codePointRanges: [[number, number], CharKind][] = [ | ||
const table: [[number, number], CharKind][] = [ |
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.
nit: rename this a more descriptive name.
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.
how about symbolTable
?
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.
Works for me.
What this PR does / why we need it:
This PR fixes the degradation issue that words which contain diacritics (e.g.,
Städte
) are separated in word motions.Which issue(s) this PR fixes
Two issues are reported in #3665:
vim.iskeyword
characters (e.g.,helloWorld(param1
) is wrongly regarded as a single word Word seperate doesn't works well #3665 (comment).adbdémm
,Städte
) is wrongly regarded as separate words Word seperate doesn't works well #3665 (comment).This PR fixes the second one. I've not been able to reproduce the original first problem...
Special notes for your reviewer:
makeAsciiWordSegments
andmakeUnicodeWordSegments
) are removed.