82
*/
83
public static columnFromVisibleColumn(lineContent: string, visibleColumn: number, tabSize: number): number {
85
>
return 1;
86
>
}
87
>
88
>
const lineContentLength = lineContent.length;
89
>
const iterator = new strings.GraphemeIterator(lineContent);
90
>
91
>
let beforeVisibleColumn = 0;
92
>
let beforeColumn = 1;
93
>
while (!iterator.eol()) {
94
>
const codePoint = strings.getNextCodePoint(lineContent, lineContentLength, iterator.offset);
95
>
iterator.nextGraphemeLength();
96
>
97
>
const afterVisibleColumn = this._nextVisibleColumn(codePoint, beforeVisibleColumn, tabSize);
98
>
const afterColumn = iterator.offset + 1;
99
>
100
>
if (afterVisibleColumn >= visibleColumn) {
101
>
const beforeDelta = visibleColumn - beforeVisibleColumn;
102
>
const afterDelta = afterVisibleColumn - visibleColumn;
103
>
if (afterDelta < beforeDelta) {
104
>
return afterColumn;
105
>
} else {
106
>
return beforeColumn;
107
>
}
108
>
}
109
>
110
>
beforeVisibleColumn = afterVisibleColumn;
111
>
beforeColumn = afterColumn;
112
>
}
113
>
114
>
// walked the entire string
115
>
return lineContentLength + 1;
116
>
}
117
118
/**