[escher] TextArea: fix cursor position when handling text with UCodePointEmpty

This commit is contained in:
Émilie Feral
2019-05-07 17:13:13 +02:00
parent 3345224d5e
commit 1e01c5dadb

View File

@@ -72,7 +72,7 @@ bool TextArea::handleEventWithText(const char * text, bool indentation, bool for
// Insert the text
if (insertTextAtLocation(buffer, cursorLocation())) {
// Set the cursor location
const char * nextCursorLocation = cursorLocation() + (forceCursorRightOfText ? strlen(buffer) : cursorPositionInCommand - text);
const char * nextCursorLocation = cursorLocation() + (forceCursorRightOfText ? strlen(buffer) : cursorPositionInCommand - buffer);
setCursorLocation(nextCursorLocation);
}
return true;