Skip to content

Commit 67e2eac

Browse files
committed
If selection start and end are 0, it means there is no selection so just put the inserted item at the beginning of the text
1 parent 3656272 commit 67e2eac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ class LineBlockFormatter(editor: AztecText) : AztecFormatter(editor) {
231231
}
232232

233233
private fun getEndOfBlock(): Int {
234+
if (selectionStart == 0 && selectionEnd == 0) {
235+
return 0
236+
}
234237
var position = 0
235238
editableText.getSpans(selectionStart, selectionEnd, IAztecBlockSpan::class.java).forEach {
236239
val spanEnd = editableText.getSpanEnd(it)

0 commit comments

Comments
 (0)