Commit Graph

2048 Commits

Author SHA1 Message Date
Kartik K. Agaram bf77258c4b Merge driver.love 2023-11-11 10:16:27 -08:00
Kartik K. Agaram 5a3deb7524 Merge luaML.love 2023-11-11 10:15:39 -08:00
Kartik K. Agaram 9d17ff31fc Merge template-live-editor 2023-11-11 10:13:04 -08:00
Kartik K. Agaram acc6e97db0 debug animations
https://merveilles.town/@akkartik/111333888472146119
2023-11-11 10:00:54 -08:00
Kartik K. Agaram 7d8148360e Merge driver.love 2023-11-10 17:50:27 -08:00
Kartik K. Agaram 37e383134a Merge luaML.love 2023-11-10 17:40:40 -08:00
Kartik K. Agaram fbad5abc70 Merge template-live-editor 2023-11-10 17:08:04 -08:00
Kartik K. Agaram d49dd49dd6 Merge text0 2023-11-10 16:51:04 -08:00
Kartik K. Agaram 6adc5f5ae0 Merge text.love 2023-11-10 16:50:35 -08:00
Kartik K. Agaram a1da45228a Merge lines.love 2023-11-10 16:40:36 -08:00
Kartik K. Agaram d90dff3286 improve a name 2023-11-10 10:21:52 -08:00
Kartik K. Agaram f86ebf6247 clean up a debug print 2023-11-10 10:20:57 -08:00
Kartik K. Agaram 279c42966b Merge text0
I've tested both syntax error and run-time error flows.
2023-11-10 10:15:35 -08:00
Kartik K. Agaram 69afab3840 Merge text.love 2023-11-10 09:10:20 -08:00
Kartik K. Agaram 3007ea0014 Merge lines.love 2023-11-10 09:05:04 -08:00
Kartik K. Agaram a6738b49c4 clean up some cruft from error callstacks
before:

  stack traceback:
    [string "text.lua"]:9: in function 'draw'
    [string "edit.lua"]:200: in function 'draw'
    [string "run.lua"]:140: in function 'draw'
    [string "main.lua"]:162: in function <[string "main.lua"]:155>
    [C]: in function 'xpcall'
    [string "app.lua"]:38: in function <[string "app.lua"]:20>
    [C]: in function 'xpcall'
    [love "boot.lua"]:370: in function <[love "boot.lua"]:337>

after:

  stack traceback:
    text.lua:9: in function 'draw'
    edit.lua:200: in function 'draw'
    run.lua:140: in function 'draw'
    main.lua:162: in function <[string "main.lua"]:155>
    [C]: in function 'xpcall'
    app.lua:38: in function <[string "app.lua"]:20>
    [C]: in function 'xpcall'
    [love "boot.lua"]:370: in function <[love "boot.lua"]:337>
2023-11-10 08:41:56 -08:00
Kartik K. Agaram 8b70258978 remove a no-op regex munging on callstacks
Port of a fix "upstream": commit b38f172ceb in template-live-editor.
2023-11-10 07:24:46 -08:00
Kartik K. Agaram 66ef316503 strip numeric prefix from callstack filenames 2023-11-10 07:06:37 -08:00
Kartik K. Agaram b38f172ceb remove a no-op regex munging on callstacks
It seems to have been introduced in commit 46889593da back in Jan, and I
was using it to summarize multiple failing tests. However, it's not used
in that scenario anymore (and anyway it seems wasteful to compute the
stack for each failing test and then throw it all away).
2023-11-09 21:16:13 -08:00
Kartik K. Agaram f443fcdca8 Merge driver.love 2023-11-09 18:52:52 -08:00
Kartik K. Agaram c6e24c8070 Merge luaML.love 2023-11-09 18:50:25 -08:00
Kartik K. Agaram cbaabce696 Merge template-live-editor 2023-11-09 18:45:35 -08:00
Kartik K. Agaram f6ee78f824 bugfix 2023-11-09 18:03:29 -08:00
Kartik K. Agaram cd5ab62971 provide a filename for clearer error callstacks 2023-11-09 17:53:30 -08:00
Kartik K. Agaram be48f72fec mention node.key in more places
Hopefully this will keep us from forgetting about it again.
2023-10-30 22:42:32 -07:00
Kartik K. Agaram fbb45f2f0e bugfix: keep definition keys up to date
I connect keys and values bidirectionally ways inside Definitions:
  * Definitions is a table, and the key points at the value.
  * Each value (node; a table) also contains the corresponding key.

However, before this commit I was not updating the key inside the node
when I was moving nodes around inside Definitions. And that was leading
to errors when I moved nodes around the surface like:

  Error: [string "REPL"]:12: attempt to index local 'node' (a nil value)
  stack traceback:
    [string "REPL"]:12: in function 'A1'
    [string "REPL"]:22: in function 'update'
    main.lua:196: in function 'update'
    app.lua:99: in function <app.lua:85>
    [C]: in function 'xpcall'
    app.lua:113: in function <app.lua:112>
    [C]: in function 'xpcall'

Why did I make this mistake? Because it's been easy to forget about
node.key.
2023-10-30 22:35:58 -07:00
Kartik K. Agaram c512c1a6ba rename var 2023-10-30 22:13:29 -07:00
Kartik K. Agaram 6125a02764 Merge driver.love 2023-10-28 01:26:13 -07:00
Kartik K. Agaram db1e163956 Merge luaML.love 2023-10-28 01:21:50 -07:00
Kartik K. Agaram 23878904b3 Merge template-live-editor 2023-10-28 01:12:35 -07:00
Kartik K. Agaram 3fb7854008 Merge text0 2023-10-28 01:05:35 -07:00
Kartik K. Agaram 6cc83d5691 Merge text.love 2023-10-28 01:02:30 -07:00
Kartik K. Agaram f737d63c69 Merge lines.love 2023-10-28 00:54:14 -07:00
Kartik K. Agaram aa9a0b0b15 use my name for a dir 2023-10-27 23:58:42 -07:00
Kartik K. Agaram 5d41640d2f remove stale variable from docs 2023-10-27 23:57:18 -07:00
Kartik K. Agaram 50e84c9b44 bugfix: switch text_input to new panning impl 2023-10-27 23:01:46 -07:00
Kartik K. Agaram ca82d861dd Merge driver.love 2023-10-27 18:35:54 -07:00
Kartik K. Agaram 32253730ac Merge luaML.love 2023-10-27 18:32:37 -07:00
Kartik K. Agaram e258a27a65 clean up debug prints
I'm feeling pretty good about this; hopefully we've fixed this for good.
2023-10-27 18:26:29 -07:00
Kartik K. Agaram b74f2b917d Merge luaML.love
Manual tests rechecked for this fork.
2023-10-27 18:23:24 -07:00
Kartik K. Agaram f78557e5e5 this seems to pass all manual tests
It's an interesting blend with my old solution; the new solution acts as
just a safety net.

It makes a couple of situations more jarring, where the screen moves
more than strictly necessary. But the core vibe of my apps is preserved:
the screen only updates when you do something.
2023-10-27 17:57:09 -07:00
Kartik K. Agaram 69d3af9ca4 recheck manual tests
Just the pagedown bug remaining.
2023-10-27 17:25:06 -07:00
Kartik K. Agaram 74db6ac95e clean up 2023-10-27 17:15:04 -07:00
Kartik K. Agaram 27733025a2 up and down arrow working at all 3 zoom levels
I don't know why I have such an almighty struggle with this stuff.
2023-10-27 17:13:28 -07:00
Kartik K. Agaram d1c65b90a3 snapshot: fix up arrow at Zoom = 1 2023-10-27 16:41:56 -07:00
Kartik K. Agaram 92c2359532 indent 2023-10-27 16:20:22 -07:00
Kartik K. Agaram feee7895e9 use the current implementation in just down-arrow
Now we have a skeleton to support up-arrow. This is probably not a good
final organization, but will hopefully be a good incremental stepping
stone.
2023-10-27 16:09:04 -07:00
Kartik K. Agaram 1031f47496 snapshot: a whole new approach to panning
Basic idea: If the goal is for the cursor to be on the viewport, focus
the code on ensuring that constraint by construction.

Motivation: The downstream driver.love fork still has persistent bugs.
And I'm seeing some inconclusive signs that edit.lua might be failing to
change screen_top some of the time when it needs to. But this only
happens in driver.love, never in lines.love. So the null hypothesis is
that there's some subtle assumption in lines.love that we're violating
when rendering it on a surface.

What do you do with such subtleties? It might actually be
counterproductive to fix them at source. You end up with complexity
upstream that won't actually matter there if it breaks. Which is a
recipe for it to break silently and far away from the downstream fork
that might actually care about it. Or it might confuse people in future
who don't care about the downstream forks, just lines.love.

Maybe it makes sense to modify edit.lua here and take the hit on all
possible future merge conflicts. But considering the cost of tracking
this down, it seems simplest to:
a) come up with the constraint I care about, and
b) modify outside edit.lua, either what it sees or its results, to
preserve the new constraint.

Long ago I used to have this assertion in pensieve.love that the cursor
must be within the viewport, but I ended up taking it out because it
kept breaking for me when I was trying to do real work. It seems clear
that there are possible assertions that are useful and yet
counterproductive. If you can't keep it out of the product in the course
of testing, then it annoys users where ignoring it would be a more
graceful experience. Even when the user is just yourself! So it turns
out this is not a problem only for large teams of extrinsically
motivated people who don't eat their own dog food. No, for some things
you have to fix the problem by construction, not just verify it with an
assertion.

This plan isn't fully working yet in this commit. I've only fixed cases
for down-arrow. I need to address up arrow, and there might also be
changes for left/right arrows. Hmm, I'm going to try to follow the
implementation of bring_cursor_of_cursor_node_in_view() in
pensieve.love.

In the process of doing this I also noticed a bug with page-up/down. It
already existed, but this approach has made it more obvious.
2023-10-27 16:07:34 -07:00
Kartik K. Agaram c43cd121dc Merge driver.love 2023-10-26 17:13:22 -07:00
Kartik K. Agaram 9e75918d5b Merge luaML.love
driver.love still failing a couple of manual tests. It's slightly
non-deterministic depending on the precise alignment of screenlines on
screen. I need to adjust how I make space for the menu bar.
2023-10-26 17:11:47 -07:00