From a26db154a548e52d16cfaf0bbdd0759e9b82a1b3 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Thu, 14 Nov 2024 16:37:11 +0800 Subject: [PATCH] fix syntax highlighting and variable highlighting were gone --- .../application/multiplatform/hellohttp/ux/bigtext/BigText.kt | 2 +- .../multiplatform/hellohttp/ux/bigtext/ConcurrentBigText.kt | 2 ++ .../multiplatform/hellohttp/ux/bigtext/InefficientBigText.kt | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigText.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigText.kt index 5a3bb8ff..a987dc10 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigText.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigText.kt @@ -49,7 +49,7 @@ interface BigText { fun substring(range: IntRange): CharSequence = substring(range.start, range.endInclusive + 1) - fun subSequence(startIndex: Int, endIndex: Int) = substring(startIndex, endIndex) + fun subSequence(startIndex: Int, endIndex: Int): CharSequence fun findLineString(lineIndex: Int): CharSequence diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/ConcurrentBigText.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/ConcurrentBigText.kt index 98700de6..1a396f53 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/ConcurrentBigText.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/ConcurrentBigText.kt @@ -61,6 +61,8 @@ open class ConcurrentBigText(private val delegate: BigText) : BigText { override fun substring(start: Int, endExclusive: Int): CharSequence = lock.read { delegate.substring(start, endExclusive) } + override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = lock.read { delegate.subSequence(startIndex, endIndex) } + override fun findLineString(lineIndex: Int): CharSequence = lock.read { delegate.findLineString(lineIndex) } override fun findRowString(rowIndex: Int): CharSequence = lock.read { delegate.findRowString(rowIndex) } diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/InefficientBigText.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/InefficientBigText.kt index f15ce61b..40875b34 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/InefficientBigText.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/InefficientBigText.kt @@ -61,6 +61,9 @@ class InefficientBigText(text: String) : BigText { override fun substring(range: IntRange): CharSequence = substring(range.first, range.last) + override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = + substring(startIndex, endIndex) + override fun findLineString(lineIndex: Int): CharSequence { TODO("Not yet implemented") }