diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/EditorSearcher.java b/editor/src/main/java/io/github/rosemoe/sora/widget/EditorSearcher.java index 03f7ca91b..da14803cf 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/EditorSearcher.java +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/EditorSearcher.java @@ -282,7 +282,11 @@ public void replaceThis(@NonNull String replacement) { return; } if (isMatchedPositionSelected()) { - editor.commitText(replacement); + if (replacement.isEmpty()) { + editor.deleteText(); + } else { + editor.commitText(replacement); + } } else { gotoNext(); }