Commit Graph

16 Commits

Author SHA1 Message Date
Kartik K. Agaram 77b464fbf0 clean up my debug conlang
This isn't the ideal implementation either. Pure spaghetti. But I need
to clean up the debug prints to see that.
2021-12-22 17:48:18 -08:00
Kartik K. Agaram 940b885be7 toot-toot: redo cursor_down as an experiment
I want to support cursor movement across wrapped lines, and the old
implementation doesn't seem on the right track for that.

Interesting that this required me to add the new symmetric test.
2021-12-22 17:45:51 -08:00
Kartik K. Agaram c393528cd2 . 2021-12-22 17:39:31 -08:00
Kartik K. Agaram e7a73626e8 toot-toot: a few more tests
..before a change in approach.
2021-12-22 11:54:54 -08:00
Kartik K. Agaram 0a1d5d61cb . 2021-12-22 11:41:45 -08:00
Kartik K. Agaram 343316dcfa more precise control over menu order
I can't believe I didn't notice this until now.
2021-12-22 00:27:50 -08:00
Kartik K. Agaram 53f235fd26 minor tweaks 2021-12-21 15:06:43 -08:00
Kartik K. Agaram dcef2347dd document dbg 2021-12-18 19:33:54 -08:00
Kartik K. Agaram 59f223e7cb toot-toot: save prose somewhere
This is still quite klunky. Don't expect toot-toot to be a complete text
editor. In particular, it'll happily lose toot data if you try to edit
the app while editing a toot. Teliva is paranoid about avoiding data
loss, but toot-toot.tlv is not.

Mostly I just want toot-toot to interact with the clipboard. The only
reason save exists is that copying directly from within the app inserts
spurious line breaks. So now I'm saving to file, then `cat`ing file,
then copying each toot out.

I initially tried to use ctrl-s for the save hotkey, but that conflicts
with terminal flow-control, and it's not obvious how ncurses manages
IXON. And I don't want to go around ncurses and do something that's very
likely to be unportable.

Even ctrl-w, I worry that there are terminals out there that will close
tab or something stupid like that.

Feature wish list:
  - a hook to execute after exit. Just calling os.exit() doesn't work
    because the screen still clears any final prints when Teliva exits.
    Not sure how to handle this. Ncurses doesn't seem to have anything
    beyond endwin() for cleaning up after itself.
  - a hook to execute before exit, for things like asking for confirmation/save
  - a place for 'flash' notification messages, like that the file was saved
2021-12-18 09:45:13 -08:00
Kartik K. Agaram d818efb7c8 pay more attention to where we display the cursor
It's still just in app control; I'm resisting the urge to introduce
"smarts".
2021-12-18 09:32:37 -08:00
Kartik K. Agaram 9fe884c03a streamline an app; pull useful stuff into template 2021-12-18 08:41:19 -08:00
Kartik K. Agaram 1d9a4fa1d5 ctrl-u: clear prose 2021-12-17 23:19:59 -08:00
Kartik K. Agaram 235e103824 bug: handle digits in prose
Lua has some Javascript-esque gotchas here. Too quick to coerce between
types.
2021-12-17 23:10:13 -08:00
Kartik K. Agaram 67264c86f8 clean up cursor_up 2021-12-17 23:03:23 -08:00
Kartik K. Agaram 04a9a63fc0 two implementations of cursor_up 2021-12-17 23:00:52 -08:00
Kartik K. Agaram 580501b342 start of a test framework
Follows https://github.com/akkartik/wart, https://github.com/akkartik/mu0,
https://github.com/akkartik/mu1 and https://github.com/akkartik/mu.
2021-12-17 22:23:17 -08:00