mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
refactor: add TextFieldState extension functions (updateText, insertUrlAtCursor, replaceCurrentWord, currentWord)
https://claude.ai/code/session_01VminH5nD1jbzncbgTaqXEK
This commit is contained in:
+2
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user