Fix cursor when pasting text with tabs
diff --git a/TextEditor.cpp b/TextEditor.cpp
index 8901f07..273e8c5 100644
--- a/TextEditor.cpp
+++ b/TextEditor.cpp
@@ -298,8 +298,14 @@
auto& line = mLines[aWhere.mLine];
auto d = UTF8CharLength(*aValue);
while (d-- > 0 && *aValue != '\0')
- line.insert(line.begin() + cindex++, Glyph(*aValue++, PaletteIndex::Default));
- ++aWhere.mColumn;
+ line.insert(line.begin() + cindex++, Glyph(*aValue, PaletteIndex::Default));
+
+ if (*aValue == '\t')
+ aWhere.mColumn += mTabSize;
+ else
+ ++aWhere.mColumn;
+
+ ++aValue;
}
mTextChanged = true;