From 39b2e8b457cc9d8dc74393e944b6868c53abbf94 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Tue, 12 Nov 2024 11:42:31 +0800 Subject: [PATCH] fix dragging backward would select one extra character than expected --- .../multiplatform/hellohttp/ux/bigtext/BigMonospaceText.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigMonospaceText.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigMonospaceText.kt index 2f2c57a3..f8d4ce77 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigMonospaceText.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/bigtext/BigMonospaceText.kt @@ -1123,7 +1123,7 @@ private fun CoreBigMonospaceText( } } selectionEnd = selectedCharIndex - viewState.transformedSelection = minOf(selectionStart, selectionEnd) .. maxOf(selectionStart, selectionEnd) + viewState.transformedSelection = minOf(selectionStart, selectionEnd) until maxOf(selectionStart, selectionEnd) log.d { "t sel = ${viewState.transformedSelection}" } viewState.updateSelectionByTransformedSelection(transformedText) viewState.transformedCursorIndex = minOf(