Commit Graph

9 Commits

Author SHA1 Message Date
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