refactor: add TextFieldState extension functions (updateText, insertUrlAtCursor, replaceCurrentWord, currentWord)

https://claude.ai/code/session_01VminH5nD1jbzncbgTaqXEK
This commit is contained in:
Vitor Pamplona
2026-03-28 13:20:00 -04:00
parent 8097ca52c6
commit 5e6c6063cd
@@ -26,7 +26,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import kotlin.math.max
import kotlin.math.min
// ── TextFieldState extensions (new BasicTextField) ──────────────────────────────────────────
// ── TextFieldState extensions (new BasicTextField) ──────────────────────────
fun TextFieldState.updateText(newText: String) {
edit {
@@ -103,7 +103,7 @@ private fun currentWordEndIdx(
return nextNewLine
}
// ── TextFieldValue extensions (legacy) ──────────────────────────────────────────────
// ── TextFieldValue extensions (legacy) ──────────────────────────────────────
fun TextFieldValue.insertUrlAtCursor(url: String): TextFieldValue {
var toInsert = url.trim()