Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -338,21 +338,21 @@ class ParagraphStyles(
}

if (isNewLine) {
if (!config.isContinuous) {
spanState.setStart(style, null)
continue
}

// If removing text at the beginning of the line, we want to remove the span for the whole paragraph
if (isBackspace) {
val currentParagraphBounds = s.getParagraphBounds(endCursorPosition)
removeSpansForRange(s, currentParagraphBounds.first, currentParagraphBounds.second, config.clazz)
spanState.setStart(style, null)
continue
} else {
s.insert(endCursorPosition, EnrichedConstants.ZWS_STRING)
endCursorPosition += 1
}

if (!config.isContinuous) {
spanState.setStart(style, null)
continue
}

s.insert(endCursorPosition, EnrichedConstants.ZWS_STRING)
endCursorPosition += 1
}

var (start, end) = s.getParagraphBounds(styleStart, endCursorPosition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class EnrichedTextWatcher(

if (view.isDuringTransaction) return
applyStyles(s)
view.layoutManager.invalidateLayout()
}

private fun applyStyles(s: Editable) {
Expand Down
Loading