From ed91c9d75af7d21e5e4d6c59bf5ff0eeda219365 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 21 Jan 2021 21:18:10 +0100 Subject: [PATCH] fix #390, make sure Undo/Redo works properly --- .../simplemobiletools/notes/pro/fragments/TextFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 6c4652b3..34cbb14e 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 @@ -169,7 +169,12 @@ class TextFragment : NoteFragment() { setTextWatcher() } - fun setTextWatcher() = view.text_note_view.addTextChangedListener(textWatcher) + fun setTextWatcher() { + view.text_note_view.apply { + removeTextChangedListener(textWatcher) + addTextChangedListener(textWatcher) + } + } fun removeTextWatcher() = view.text_note_view.removeTextChangedListener(textWatcher)