simplify stringIndexToBufferIndex, fix docs

This commit is contained in:
Jörg Breitbart
2018-09-14 14:19:25 +02:00
parent 57bbbda7e8
commit 14c20c5f32
+1 -4
View File
@@ -199,7 +199,7 @@ export class Buffer implements IBuffer {
* To get the correct buffer position the string must start at `startCol` 0
* (default in translateBufferLineToString).
* The method also works on wrapped line strings given rows were not trimmed.
* The method operates on the CharData width attribute, there are no
* The method operates on the CharData string length, there are no
* additional content or boundary checks. Therefore the string and the buffer
* should not be altered in between.
* TODO: respect trim flag after fixing #1685
@@ -208,9 +208,6 @@ export class Buffer implements IBuffer {
* @param startCol column offset the string was retrieved from
*/
public stringIndexToBufferIndex(lineIndex: number, stringIndex: number): BufferIndex {
if (!stringIndex) {
return [lineIndex, 0];
}
while (stringIndex) {
const line = this.lines.get(lineIndex);
if (!line) {