From 0a58e68ad438ff43fa5bbecdb8914aa00cab5099 Mon Sep 17 00:00:00 2001 From: citrons Date: Sat, 31 May 2025 07:16:32 -0500 Subject: support cursor in TUI layouts --- tui/text_input.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tui/text_input.go (limited to 'tui/text_input.go') diff --git a/tui/text_input.go b/tui/text_input.go new file mode 100644 index 0000000..a8c7d6d --- /dev/null +++ b/tui/text_input.go @@ -0,0 +1,15 @@ +package tui + +import ( +// "github.com/rivo/uniseg" +// "strings" +) + +type TextInput struct { + Contents string + Cursor int +} + +func (t *TextInput) Update(ev Event) { + t.Cursor = max(t.Cursor, 0) +} -- cgit v1.2.3