From 628784c213c4e37cacb4d7e889220997356f797f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Mar 2020 21:26:30 +0200 Subject: [PATCH] do not allow undoing the initial note content setup --- .../com/simplemobiletools/notes/pro/fragments/TextFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt index 9cb22532..fcbce186 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt @@ -130,7 +130,9 @@ class TextFragment : NoteFragment() { gravity = config.getTextGravity() if (text.toString() != fileContents) { if (!skipTextUpdating) { + removeTextWatcher() setText(fileContents) + setTextWatcher() } skipTextUpdating = false setSelection(if (config.placeCursorToEnd) text.length else 0) @@ -159,6 +161,7 @@ class TextFragment : NoteFragment() { } fun setTextWatcher() = view.text_note_view.addTextChangedListener(textWatcher) + fun removeTextWatcher() = view.text_note_view.removeTextChangedListener(textWatcher) fun updateNoteValue(value: String) {