Commit e44eaad
Refactored cursor and selection manipulation, and more! (#146)
* Refactored cursor and selection manipulation, and more!
Issue #145
textboxes.nim
- Implemented cursor + anchor model for selection
- Refactored almost all cursor movement procedurs into shiftCursor
- Created an Orient enum with enumerators for shiftCursor (e.g. Left,
NextWord, TheEnd)
- Created placeCursor procedure for direct placement by index
- Created clearSelection procedure
- Created growSelection procedure
- Rewrote delete and created deleteSelected
- Rewrote insert, cursorUp, cursorDown, `selection=`, and findLine
- Organized the cursor and selection procedures
- Wrote documentation for various procedures
- Change NextWord / PreviousWord functionality to always jump to the
beginning of each word
input.nim
- Ensured the cursor blinks
- Created activate() procedure
- Rewrote delete-previous-word logic
- Switched word skipping to Meta+Arrow-keys (this is much more common)
- Switched word selection to Meta+Shift+Arrow-keys
- Eliminated cursor alignment problem by connecting layoutResize slot
tinput.nim
- Ensured input is activated, and the cursor is visible on init
- Ensured cursor is placed at TheEnd on init
tinput2.nim
- Ensured input is activated, and the cursor is visible on init
- Ensured all numbers are editable
ttextboxes.nim
- Updated tests based on new model / procedures
* Update src/figuro/ui/textboxes.nim
* Update src/figuro/widgets/input.nim
---------
Co-authored-by: Jaremy Creechley <creechley@gmail.com>1 parent 1f087dd commit e44eaad
5 files changed
Lines changed: 456 additions & 426 deletions
0 commit comments