File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/src/main/kotlin/com/simplemobiletools/notes/fragments Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ import android.view.View
1616import android.view.ViewGroup
1717import android.view.inputmethod.EditorInfo
1818import androidx.annotation.RequiresApi
19- import com.simplemobiletools.commons.extensions.beGone
20- import com.simplemobiletools.commons.extensions.beVisible
21- import com.simplemobiletools.commons.extensions.onGlobalLayout
22- import com.simplemobiletools.commons.extensions.removeBit
19+ import com.simplemobiletools.commons.extensions.*
2320import com.simplemobiletools.notes.R
2421import com.simplemobiletools.notes.activities.MainActivity
2522import com.simplemobiletools.notes.extensions.config
@@ -214,7 +211,13 @@ class NoteFragment : androidx.fragment.app.Fragment() {
214211 val end = start + if (edit.after != null ) edit.after.length else 0
215212
216213 isUndoOrRedo = true
217- text.replace(start, end, edit.before)
214+ try {
215+ text.replace(start, end, edit.before)
216+ } catch (e: Exception ) {
217+ activity?.showErrorToast(e)
218+ return
219+ }
220+
218221 isUndoOrRedo = false
219222
220223 for (span in text.getSpans(0 , text.length, UnderlineSpan ::class .java)) {
You can’t perform that action at this time.
0 commit comments