diff --git a/apps/code/editor_controller.cpp b/apps/code/editor_controller.cpp index c1646ce2e..7f33af4fd 100644 --- a/apps/code/editor_controller.cpp +++ b/apps/code/editor_controller.cpp @@ -63,6 +63,7 @@ void EditorController::viewWillAppear() { } void EditorController::viewDidDisappear() { + m_editorView.resetSelection(); m_menuController->scriptContentEditionDidFinish(); } diff --git a/apps/code/editor_view.cpp b/apps/code/editor_view.cpp index 83bc13cc2..cfcbe8113 100644 --- a/apps/code/editor_view.cpp +++ b/apps/code/editor_view.cpp @@ -16,6 +16,10 @@ EditorView::EditorView(Responder * parentResponder, App * pythonDelegate) : m_textArea.setScrollViewDelegate(this); } +void EditorView::resetSelection() { + m_textArea.resetSelection(); +} + void EditorView::scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) { m_gutterView.setOffset(scrollViewDataSource->offset().y()); } diff --git a/apps/code/editor_view.h b/apps/code/editor_view.h index 33bce89a4..bbc608e88 100644 --- a/apps/code/editor_view.h +++ b/apps/code/editor_view.h @@ -9,6 +9,7 @@ namespace Code { class EditorView : public Responder, public View, public ScrollViewDelegate { public: EditorView(Responder * parentResponder, App * pythonDelegate); + void resetSelection(); void setTextAreaDelegates(InputEventHandlerDelegate * inputEventHandlerDelegate, TextAreaDelegate * delegate) { m_textArea.setDelegates(inputEventHandlerDelegate, delegate); } diff --git a/escher/include/escher/text_input.h b/escher/include/escher/text_input.h index 32436b996..988d6a03f 100644 --- a/escher/include/escher/text_input.h +++ b/escher/include/escher/text_input.h @@ -15,6 +15,7 @@ public: const char * cursorLocation() const { return nonEditableContentView()->cursorLocation(); } bool setCursorLocation(const char * location); virtual void scrollToCursor(); + void resetSelection() { contentView()->resetSelection(); } protected: class ContentView : public View { public: