about summary refs log tree commit diff stats
path: root/toot-toot.tlv
Commit message (Collapse)AuthorAgeFilesLines
* toot-toot: stop clobbering existing filesKartik K. Agaram2022-03-311-0/+62
| | | | | | | | | | I've been reluctant to do this until now because it makes it more difficult to grant an app the ideal permissions. Here's what I use: return string.find(filename, 'toot') == 1 But I'm also trying to keep people from looking to the app to figure out what permissions to give it :/
* toot-toot: disable ctrl-kKartik K. Agaram2022-03-301-0/+51
| | | | | | | | | Rather than invest LoC in asking for confirmation or an undo feature, just have people restart to clear the page. I fucking suck for how many ways I can come up with to lose data in a text editor. It really should have been fucking obvious that clearing the page so easily was a footgun just waiting to happen.
* some more reorg of the standard libraryKartik K. Agaram2022-03-271-23/+23
| | | | | Now life.tlv and gemini.tlv are also minimizing how much of the standard library they pull in, just to be easy to read.
* helper: count permutationsKartik K. Agaram2022-03-271-0/+50
|
* helper: countKartik K. Agaram2022-03-271-0/+16
|
* graphviz: for basic stats, show all nodes orderedKartik K. Agaram2022-03-191-0/+47
| | | | | | The ordering is topological; nodes come before their dependencies. Also some more helpful functions in the template for new apps.
* standardize common helpers across all appsKartik K. Agaram2022-03-191-1/+124
| | | | | In particular, I merged take_out in anagrams.tlv with all_but in graphviz.
* graphviz: draft notion of nodes in 'focus'Kartik K. Agaram2022-03-181-1/+12
| | | | | Now the REPL isn't about deciding what to calculate, but just what nodes to calculate it for.
* graphviz: don't interpret substrings as regexesKartik K. Agaram2022-03-181-0/+4
|
* break.tlv: nascent live-updating stack languageKartik K. Agaram2022-03-171-0/+2
| | | | | | | | | Joint work with Sumeet Agarwal. In the process we discovered several bugs in our fake window helpers for tests. Thanks Sumeet! Previous prototypes: - https://archive.org/details/akkartik-2min-2020-12-06 - https://merveilles.town/@akkartik/105759816342173743
* toot-toot.tlv: scrollingKartik K. Agaram2022-03-121-1/+109
|
* use method syntax where possibleKartik K. Agaram2022-03-061-6/+6
| | | | | | Perhaps this is a bad idea. It feels arbitrary, what methods Lua happens to include in string and table objects without having to go through the respective modules.
* reconcile all apps with template.tlvKartik K. Agaram2022-03-061-6/+39
| | | | | | They may take more or less from it (sieve.tlv in particular takes nothing since call depth doesn't help at all there), but what they take is in the right order so that you can compare across apps.
* distinguish between window global and argKartik K. Agaram2022-03-021-5/+5
|
* starting to make Teliva apps more testableKartik K. Agaram2022-02-271-3/+3
| | | | | | | | | | Tasteful apps should only perform side-effects through 'window' arguments rather than the 'curses' module directly. It's ok however to read constants like curses.A_NORMAL or curses.stdscr(). There are some limitations, unfortunately. Ncurses wasn't designed with testability in mind. For example, there's no way to curs_set or assume_default_colors without the 'curses' module. Oh well.
* 'doc:blurb': a place to briefly describe an appKartik K. Agaram2022-02-171-0/+6
| | | | | | This is for what the app does, as opposed to 'doc:main', which is also intended to include commentary about the internal organization of the app.
* fix a conflicting keyboard shortcutKartik K. Agaram2022-02-171-2/+2
|
* Lua gotcha: iterating over strings yields stringsKartik K. Agaram2022-02-081-3/+3
|
* toot-toot: gracefully handle lack of permissionsKartik K. Agaram2022-01-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | This opens up a whole new can of worms: Teliva's ability to show clear error messages hinges on apps having decent error handling. I suppose that's ok. A new app someone downloads that throws out strange error messages and puts them in the equivalent of the console doesn't exactly engender trust. It's reasonable to treat poor error handling as breakage. Here's my running list of open questions from working on the permissions screen so far: - how to teach people to care about the difference between: - permissions known to be unsafe - permissions unknown to be safe - how to show syntax errors in the permissions screen - how to detect syntax errors in the permissions screen (lots of stuff only shows up when running) - how to deal with apps with poor error handling (this commit; punt for now) - how to engender skepticism in people towards what apps tell them ("oh, just go into the permissions screen and type ___ to fix this error") - how to help people judge the quality of their permissions (mode == 'r' vs mode ~= 'w')
* toot-toot: support backspace on MacKartik K. Agaram2021-12-231-1/+1
|
* toot-toot: cursor_down now handles wrapping linesKartik K. Agaram2021-12-231-8/+31
|
* clean up debug printsKartik K. Agaram2021-12-231-9/+0
|
* toot-toot: plug width into cursor movementKartik K. Agaram2021-12-231-3/+4
|
* toot-toot: reorg definitionsKartik K. Agaram2021-12-231-209/+113
|
* toot-toot: clean up historyKartik K. Agaram2021-12-231-233/+60
|
* toot-toot: cursor_up now handles wrapping linesKartik K. Agaram2021-12-231-6/+12
|
* snapshot: more tests for cursor_upKartik K. Agaram2021-12-231-0/+208
| | | | I think this may be all the tests. Now to make them pass..
* toot-toot: more elaborate cursor_upKartik K. Agaram2021-12-221-12/+59
|
* toot-toot: more verbose but clearer cursor_downKartik K. Agaram2021-12-221-16/+44
| | | | I actually got all tests to pass on the first try.
* clean up my debug conlangKartik K. Agaram2021-12-221-6/+0
| | | | | This isn't the ideal implementation either. Pure spaghetti. But I need to clean up the debug prints to see that.
* toot-toot: redo cursor_down as an experimentKartik K. Agaram2021-12-221-9/+30
| | | | | | | 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.
* .Kartik K. Agaram2021-12-221-1/+1
|
* toot-toot: a few more testsKartik K. Agaram2021-12-221-1/+16
| | | | ..before a change in approach.
* .Kartik K. Agaram2021-12-221-29/+19
|
* more precise control over menu orderKartik K. Agaram2021-12-221-3/+4
| | | | I can't believe I didn't notice this until now.
* minor tweaksKartik K. Agaram2021-12-211-20/+1
|
* document dbgKartik K. Agaram2021-12-181-0/+2
|
* toot-toot: save prose somewhereKartik K. Agaram2021-12-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* pay more attention to where we display the cursorKartik K. Agaram2021-12-181-0/+1
| | | | | It's still just in app control; I'm resisting the urge to introduce "smarts".
* streamline an app; pull useful stuff into templateKartik K. Agaram2021-12-181-8813/+55
|
* ctrl-u: clear proseKartik K. Agaram2021-12-171-0/+96
|
* bug: handle digits in proseKartik K. Agaram2021-12-171-4/+686
| | | | | Lua has some Javascript-esque gotchas here. Too quick to coerce between types.
* clean up cursor_upKartik K. Agaram2021-12-171-4/+29
|
* two implementations of cursor_upKartik K. Agaram2021-12-171-0/+1830
|
* start of a test frameworkKartik K. Agaram2021-12-171-0/+6598
Follows https://github.com/akkartik/wart, https://github.com/akkartik/mu0, https://github.com/akkartik/mu1 and https://github.com/akkartik/mu.