[apps/editor_controller] Fix backspace handling in text area

The editor controller handles backspace if it is at the beginning of a
line, to remove multiple spaces to match the indentation, but it should
not do so if there is an ongoing selection
This commit is contained in:
Léa Saviot
2020-01-13 12:09:11 +01:00
parent ce20f3f50f
commit 5a7c03d485
2 changed files with 2 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events:
return true;
}
if (event == Ion::Events::Backspace) {
if (event == Ion::Events::Backspace && textArea->selectionIsEmpty()) {
/* If the cursor is on the left of the text of a line, backspace one
* indentation space at a time. */
const char * text = textArea->text();