Skip to content

Commit 628784c

Browse files
committed
do not allow undoing the initial note content setup
1 parent 7550daf commit 628784c

File tree

1 file changed

+3
-0
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments

1 file changed

+3
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class TextFragment : NoteFragment() {
130130
gravity = config.getTextGravity()
131131
if (text.toString() != fileContents) {
132132
if (!skipTextUpdating) {
133+
removeTextWatcher()
133134
setText(fileContents)
135+
setTextWatcher()
134136
}
135137
skipTextUpdating = false
136138
setSelection(if (config.placeCursorToEnd) text.length else 0)
@@ -159,6 +161,7 @@ class TextFragment : NoteFragment() {
159161
}
160162

161163
fun setTextWatcher() = view.text_note_view.addTextChangedListener(textWatcher)
164+
162165
fun removeTextWatcher() = view.text_note_view.removeTextChangedListener(textWatcher)
163166

164167
fun updateNoteValue(value: String) {

0 commit comments

Comments
 (0)