fix invalid string and buffer index

This commit is contained in:
Jörg Breitbart
2018-12-17 23:59:48 +01:00
parent 4feed2dabc
commit 5460068d52
3 changed files with 40 additions and 3 deletions
+1 -1
View File
@@ -252,7 +252,7 @@ export class Buffer implements IBuffer {
while (stringIndex) {
const line = this.lines.get(lineIndex);
if (!line) {
[-1, -1];
return [-1, -1];
}
for (let i = 0; i < line.length; ++i) {
stringIndex -= line.get(i)[CHAR_DATA_CHAR_INDEX].length;