diff --git a/apps/code/editor_controller.cpp b/apps/code/editor_controller.cpp index 65beb5ea2..f3e5e8b94 100644 --- a/apps/code/editor_controller.cpp +++ b/apps/code/editor_controller.cpp @@ -80,14 +80,10 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events: indentationIndex++; } } - char * indentationBuffer = new char [indentationSize+2]; - indentationBuffer[0] = '\n'; + textArea->handleEventWithText("\n"); for (int i = 0; i < indentationSize; i++) { - indentationBuffer[i+1] = ' '; + textArea->handleEventWithText(" "); } - indentationBuffer[indentationSize+1] = 0; - textArea->handleEventWithText(indentationBuffer); - delete[] indentationBuffer; return true; }