diff --git a/app/src/main/java/com/m57/hermescontrol/ui/chat/components/MessageCards.kt b/app/src/main/java/com/m57/hermescontrol/ui/chat/components/MessageCards.kt index 2d6dfd40..115fea27 100644 --- a/app/src/main/java/com/m57/hermescontrol/ui/chat/components/MessageCards.kt +++ b/app/src/main/java/com/m57/hermescontrol/ui/chat/components/MessageCards.kt @@ -384,7 +384,7 @@ internal fun highlightSyntax(code: String): AnnotatedString = } else if (m.first.first > last.first.first) { // Overlap, this match starts later — it wins the overlapping portion // Keep the last match's pre-overlap, then replace - resolved.removeLast() + resolved.removeAt(resolved.lastIndex) // Split: keep text before overlap from last match if (last.first.first < m.first.first) { resolved.add(last.first.first..