diff options
| author | citrons <citrons@mondecitronne.com> | 2025-05-31 07:16:32 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-05-31 07:16:32 -0500 |
| commit | 0a58e68ad438ff43fa5bbecdb8914aa00cab5099 (patch) | |
| tree | cb53e132302297881d5be79813afc62a05320eda /tui/text_input.go | |
| parent | 22a50b723eb93c97d67eac362422d2424436b16b (diff) | |
support cursor in TUI layouts
Diffstat (limited to 'tui/text_input.go')
| -rw-r--r-- | tui/text_input.go | 15 |
1 files changed, 15 insertions, 0 deletions
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) +} |
