For those who likes to code ❤ (#113)

This commit is contained in:
devdl11
2021-12-28 14:13:01 +00:00
committed by GitHub
parent 70b162e63b
commit 0860e48cb6
7 changed files with 34 additions and 11 deletions

View File

@@ -63,7 +63,7 @@ void EditorController::didBecomeFirstResponder() {
void EditorController::viewWillAppear() {
ViewController::viewWillAppear();
m_editorView.loadSyntaxHighlighter();
m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text()));
m_editorView.setCursorLocation(m_script.content() + *m_script.CursorPosition());
}
void EditorController::viewDidDisappear() {
@@ -72,6 +72,7 @@ void EditorController::viewDidDisappear() {
}
bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events::Event event) {
m_script.setCursorPosition(textArea->cursorLocation() - m_script.content());
if (App::app()->textInputDidReceiveEvent(textArea, event)) {
return true;
}
@@ -157,7 +158,7 @@ void EditorController::cleanStorageEmptySpace() {
Ion::Storage::Record::Data scriptValue = m_script.value();
Ion::Storage::sharedStorage()->getAvailableSpaceFromEndOfRecord(
m_script,
scriptValue.size - Script::StatusSize() - (strlen(m_script.content()) + 1)); // TODO optimize number of script fetches
scriptValue.size - Script::StatusSize() - Script::CursorPositionSize() - (strlen(m_script.content()) + 1)); // TODO optimize number of script fetches
}