diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-12-19 12:40:06 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-12-19 12:40:14 +0300 |
commit | b5f66d88d740eb2e79f88fb0b85331c2d4b0e292 (patch) | |
tree | 084383f3d8eba631511cd53e5aa812ec31e2512a | |
parent | 5fe811ba1d7baeb4afcc61cf5b67c377634d6a5c (diff) |
Make getEndOfLine more performant in some scenarios
Signed-off-by: Stefan Niedermann <info@niedermann.it>
-rw-r--r-- | markdown/src/main/java/it/niedermann/android/markdown/markwon/format/ContextBasedFormattingCallback.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/src/main/java/it/niedermann/android/markdown/markwon/format/ContextBasedFormattingCallback.java b/markdown/src/main/java/it/niedermann/android/markdown/markwon/format/ContextBasedFormattingCallback.java index 2918b1314..c4469bc31 100644 --- a/markdown/src/main/java/it/niedermann/android/markdown/markwon/format/ContextBasedFormattingCallback.java +++ b/markdown/src/main/java/it/niedermann/android/markdown/markwon/format/ContextBasedFormattingCallback.java @@ -39,7 +39,7 @@ public class ContextBasedFormattingCallback implements ActionMode.Callback { final int cursorPosition = editText.getSelectionStart(); if (cursorPosition >= 0 && cursorPosition <= text.length()) { final int startOfLine = getStartOfLine(text, cursorPosition); - final int endOfLine = getEndOfLine(text, startOfLine); + final int endOfLine = getEndOfLine(text, cursorPosition); final String line = text.subSequence(startOfLine, endOfLine).toString(); if (lineStartsWithCheckbox(line)) { menu.findItem(R.id.checkbox).setVisible(false); |