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) {