[code] Avoid init/deinit-ing uPy in each editor redraw

This commit is contained in:
Romain Goyet
2018-06-04 14:57:10 +02:00
committed by EmilieNumworks
parent b52590e2f7
commit caff93cda0
4 changed files with 24 additions and 16 deletions

View File

@@ -53,6 +53,7 @@ void EditorController::didBecomeFirstResponder() {
}
void EditorController::viewWillAppear() {
m_editorView.loadSyntaxHighlighter();
m_editorView.setCursorLocation(strlen(m_editorView.text()));
}
@@ -60,6 +61,7 @@ void EditorController::viewDidDisappear() {
m_menuController->scriptContentEditionDidFinish();
delete[] m_areaBuffer;
m_areaBuffer = nullptr;
m_editorView.unloadSyntaxHighlighter();
}
bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events::Event event) {