[apps/code] Add a setting for cursor saving (#125)

This commit is contained in:
Yaya-Cout
2022-01-14 13:42:30 +01:00
committed by GitHub
parent f296778014
commit f862cb023a
14 changed files with 38 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
#include "app.h"
#include <escher/metric.h>
#include <ion.h>
#include "../global_preferences.h"
using namespace Shared;
@@ -63,7 +64,11 @@ void EditorController::didBecomeFirstResponder() {
void EditorController::viewWillAppear() {
ViewController::viewWillAppear();
m_editorView.loadSyntaxHighlighter();
m_editorView.setCursorLocation(m_script.content() + *m_script.CursorPosition());
if(GlobalPreferences::sharedGlobalPreferences()->cursorSaving()) {
m_editorView.setCursorLocation(m_script.content() + *m_script.CursorPosition());
} else {
m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text()));
}
}
void EditorController::viewDidDisappear() {