diff --git a/sample/common/src/commonMain/kotlin/com/mohamedrejeb/richeditor/sample/common/spellcheck/SpellCheckContent.kt b/sample/common/src/commonMain/kotlin/com/mohamedrejeb/richeditor/sample/common/spellcheck/SpellCheckContent.kt index 23fbcfe2..3003cbfa 100644 --- a/sample/common/src/commonMain/kotlin/com/mohamedrejeb/richeditor/sample/common/spellcheck/SpellCheckContent.kt +++ b/sample/common/src/commonMain/kotlin/com/mohamedrejeb/richeditor/sample/common/spellcheck/SpellCheckContent.kt @@ -109,7 +109,7 @@ fun SpellCheckContent() { // This is a very naive algorithm that just removes all spell check spans and // reruns the entire spell check again richTextState.textChanges.debounceUntilQuiescent(1.seconds).collect { updated -> - val newTextHash = updated.toText().hashCode() + val newTextHash = updated.annotatedString.hashCode() if (lastTextHash != newTextHash) { // Remove all existing spell checks richTextState.getAllRichSpans() @@ -206,7 +206,7 @@ fun SpellCheckContent() { } } -fun String.getWords(): Sequence> { +private fun String.getWords(): Sequence> { return sequence { var startIndex = -1 for (i in indices) {