mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] Fixed cursor bug when inserting text in editor.
Now the cursor moves only if the insterion was successful. Change-Id: If2f74307aecd4b9b86183a3437a53fd8875c1751
This commit is contained in:
@@ -45,7 +45,9 @@ bool EditorController::textAreaShouldFinishEditing(TextArea * textArea, Ion::Eve
|
||||
bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events::Event event) {
|
||||
const char * pythonText = Helpers::PythonTextForEvent(event);
|
||||
if (pythonText != nullptr) {
|
||||
textArea->insertText(pythonText);
|
||||
if (!textArea->insertText(pythonText)) {
|
||||
return false;
|
||||
}
|
||||
if (pythonText[strlen(pythonText)-1] == ')') {
|
||||
textArea->moveCursor(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user