aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java
index 13ae3a79..a43b0ffc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java
@@ -99,9 +99,13 @@ public class Utils {
}
} else if (currentChar == ' ' || currentChar == '\n') {
if (newestCaretIndex >= 0) {
- regexed.insert(i, '^');
- newestCaretIndex = -1;
- i++;
+ if (i != newestCaretIndex + 1) {
+ regexed.insert(i, '^');
+ newestCaretIndex = -1;
+ i++;
+ } else {
+ newestCaretIndex = -1;
+ }
}
} else if (currentChar == '(') {
if (newestCaretIndex >= 0 && i == newestCaretIndex + 1) {