mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Merge pull request #44259 from yh1224/fulllwidth
Treat full-width character as two visible columns.
This commit is contained in:
commit
bae62c11c0
|
@ -454,6 +454,8 @@ export class CursorColumns {
|
|||
let charCode = lineContent.charCodeAt(i);
|
||||
if (charCode === CharCode.Tab) {
|
||||
result = this.nextTabStop(result, tabSize);
|
||||
} else if (strings.isFullWidthCharacter(charCode)) {
|
||||
result = result + 2;
|
||||
} else {
|
||||
result = result + 1;
|
||||
}
|
||||
|
@ -479,6 +481,8 @@ export class CursorColumns {
|
|||
let afterVisibleColumn: number;
|
||||
if (charCode === CharCode.Tab) {
|
||||
afterVisibleColumn = this.nextTabStop(beforeVisibleColumn, tabSize);
|
||||
} else if (strings.isFullWidthCharacter(charCode)) {
|
||||
afterVisibleColumn = beforeVisibleColumn + 2;
|
||||
} else {
|
||||
afterVisibleColumn = beforeVisibleColumn + 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue