Commit Graph

29 Commits

Author SHA1 Message Date
Christian Rocha
d02641f6b5 Update textinput for multi-char (IME) input in Bubble Tea master 2020-11-01 09:11:18 -05:00
Christian Rocha
9b47f26bdd
Doc and logic corrections per the linter 2020-10-28 21:27:15 -04:00
Christian Rocha
9c780011ff
Underpinnings for always-on and always-hidden cursor modes 2020-10-28 21:27:15 -04:00
Christian Rocha
8148e61443
Correct ^F/^B keybindings for forward/back cursor movement 2020-10-28 21:27:15 -04:00
Christian Rocha
ce7d8da084
Fix lock-up that could occur with cursor blinking
Note that to do this we've replaced the blink timer with a context.
2020-10-28 21:27:15 -04:00
Christian Rocha
d14fdf585c
Textinput Update and View functions are now methods on the model 2020-10-28 21:27:15 -04:00
Christian Rocha
bf7719e6c1
Handle paste via command/message since it's IO 2020-10-28 21:27:15 -04:00
Christian Rocha
1b530b293c
Reset blink timer when moving the cursor 2020-10-28 21:27:15 -04:00
Christian Muehlhaeuser
97020cd0d2
Support Alt-Backspace to delete previous word 2020-10-27 08:50:22 +01:00
Christian Muehlhaeuser
f58fead10d Support Ctrl-W and Alt-D to delete words left/right of cursor
Ctrl-W: deletes word left of cursor
Alt-D: deletes word right of cursor
2020-10-25 14:52:16 -04:00
Christian Rocha
703de11da4 Fix regression where cursor was misplaced after a paste 2020-10-24 19:51:13 -04:00
Christian Rocha
03461d6804 Fix panic when pasting into a textinput with no char limit 2020-10-24 19:51:13 -04:00
Christian Muehlhaeuser
a0fe547fdb Make textinput cursor visible whenever it changes its position
This improves the UX because you never lose track of the cursor
moving around while it's currently hidden.
2020-10-24 00:12:27 -04:00
Christian Rocha
bdd909a5d7 Textinput: bind home/end and fix behavior of delete key 2020-10-22 15:36:54 -04:00
Christian Muehlhaeuser
83b6a2205f
Add an EchoMode and EchoCharacter property to textinputs (#11)
EchoModes are:

- EchoNormal, displays text as is
- EchoPassword, displays EchoCharacter mask instead of actual characters
- EchoNone, displays nothing

Note that EchoOnEdit, which should displays character as they are entered and is otherwise identical to EchoPassword, is not yet implemented.
2020-10-21 18:17:41 -04:00
Christian Rocha
9c10cd0586
Remove unused ErrMsg type from textinput module 2020-10-15 18:52:36 -04:00
Christian Rocha
154f3763f7
textinput.View can just accept a textinput.Model argument 2020-10-15 18:43:08 -04:00
Christian Muehlhaeuser
f78a02cc29
Avoid unnecessary conversions 2020-08-22 12:41:37 +02:00
Christian Muehlhaeuser
9a4fbb3be1
Make golint happy 2020-08-22 12:41:09 +02:00
Christian Rocha
f11ca377f4
Add clipboard paste support to textarea 2020-07-23 11:53:58 -04:00
Christian Rocha
10022c964c
Fix slice out of bounds errors that could happen when deleting text 2020-07-21 18:22:18 -04:00
Christian Rocha
f967f6a87f
Fix a bug where placeholder text would not reappear post-input 2020-06-22 15:28:38 -04:00
Christian Rocha
e9dd6b06e0
Fix duplicate character bug when deleting chars in long strings
If the string is longer than the width of the field and the horizontal
viewport (so to speak) was on the right edge, the last character would
repeat when deleting characters because the viewport offset wasn't being
corrected. This fixes that.
2020-06-20 23:34:19 -04:00
Christian Rocha
d3192a3e70
Update text input viewport scrolling to handle unicode characters 2020-06-11 21:24:41 -04:00
Christian Rocha
74cc86fce5
Use a slice of runes as the underlying textinput value 2020-06-11 18:35:18 -04:00
Christian Rocha
87c7cd778f
Rename to Bubbles + copy over components from Bubble Tea + remove examples 2020-05-25 20:08:37 -04:00
Christian Rocha
da64445a0e
Update subs for Tea v0.2.1. That is to say, remove the their arguments. 2020-05-04 18:54:26 -04:00
Christian Rocha
7ef18ab69e
Fix a bug where text inputs with no char limit couldn't take input 2020-04-23 12:10:53 -04:00
Christian Rocha
bf2d13df66
Rename input to textinput + DefaultModel is now NewModel 2020-04-23 12:10:09 -04:00