You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
This feature request includes a fix of #3439, which specifically mentioned Chinese characters.
Describe the solution you'd like
Word motions (w, b, ...) move a cursor too far away on non-ASCII characters (e.g., CJK ideographs). This issue doesn't occur in the original Vim.
Vim regards a word as a sequence of characters which have the same class (cf. fwd_word in src/search.c). In UTF-8 encoding, the function cls (in src/search.c) returns the class which distinguishes the different kinds of symbols (punctuations, ideographs, emoji, ...) according to the table in src/mbyte.c.
It would be great if VSCodeVim follows this behavior. I've made a prototype implementation for this change that modifies makeWordRegex in src/common/motion/position.ts to support non-ASCII characters.
Describe alternatives you've considered
For Japanese, an ad-hoc fix has been proposed in https://qiita.com/jagijagijag1/items/4badc62d2627705a3eb0, which appends several punctuations, parentheses, and Japanese post-positional particles to editor.wordSeparators.
This reduces the problem but is not a perfect solution, because it causes another problem that cursors sometimes stop in the middle of words.
Additional context
Screen captures of results of word motions (w and b)
VSCodeVim
Vim (preferred)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
This feature request includes a fix of #3439, which specifically mentioned Chinese characters.
Describe the solution you'd like
Word motions (w, b, ...) move a cursor too far away on non-ASCII characters (e.g., CJK ideographs). This issue doesn't occur in the original Vim.
Vim regards a word as a sequence of characters which have the same class (cf.
fwd_word
in src/search.c). In UTF-8 encoding, the functioncls
(in src/search.c) returns the class which distinguishes the different kinds of symbols (punctuations, ideographs, emoji, ...) according to the table in src/mbyte.c.It would be great if VSCodeVim follows this behavior. I've made a prototype implementation for this change that modifies
makeWordRegex
in src/common/motion/position.ts to support non-ASCII characters.Describe alternatives you've considered
For Japanese, an ad-hoc fix has been proposed in https://qiita.com/jagijagijag1/items/4badc62d2627705a3eb0, which appends several punctuations, parentheses, and Japanese post-positional particles to
editor.wordSeparators
.This reduces the problem but is not a perfect solution, because it causes another problem that cursors sometimes stop in the middle of words.
Additional context
Screen captures of results of word motions (w and b)
VSCodeVim
Vim (preferred)
The text was updated successfully, but these errors were encountered: