Commit Graph

1320 Commits

Author SHA1 Message Date
Kartik K. Agaram f41a1fc69d bugfix: recover from error on new command
Second issue introduced in commit a2451aa26. It's worth checking error
recovery in the simpler test, even though it's technically caught in the
next one. A little redundancy seems good here.
2023-04-22 18:05:16 -07:00
Kartik K. Agaram f994d61f96 Merge text0 2023-04-21 23:36:35 -07:00
Kartik K. Agaram 4eb4042d61 Merge text.love 2023-04-21 23:36:27 -07:00
Kartik K. Agaram 6274df27c3 Merge lines.love 2023-04-21 23:29:47 -07:00
Kartik K. Agaram ac27d36dd0 delete inapplicable issue 2023-04-21 23:25:28 -07:00
Kartik K. Agaram 0b50c3bf6c delete inapplicable issues 2023-04-21 23:17:07 -07:00
Kartik K. Agaram 43503aeea6 Merge text0 2023-04-21 23:15:22 -07:00
Kartik K. Agaram 6b283ebfec Merge text.love 2023-04-21 23:14:49 -07:00
Kartik K. Agaram 8e0fb09483 Merge lines.love 2023-04-21 23:10:09 -07:00
Kartik K. Agaram b9d3cf3578 correct a characterization 2023-04-21 22:53:40 -07:00
Kartik K. Agaram dfebb80a2f add a link 2023-04-21 11:43:14 -07:00
Kartik K. Agaram 4fb97b9d34 bugfix: wasn't recovering from errors
Bug was introduced in commit a2451aa26 32 hours ago, because I didn't go
over the manual tests for the error-handling protocol after modifying
the error-handling protocol. (I only tested them in template-live.)
2023-04-21 08:18:00 -07:00
Kartik K. Agaram b4a9f7f7f1 bugfix: only include files with numeric _prefixes_
A Lua gotcha: gmatch doesn't support '^'. I don't know why I was doing
that weird single-iteration loop anyway.
2023-04-20 23:42:44 -07:00
Kartik K. Agaram 0fc9fc5f22 show how to load lines in editor 2023-04-20 23:41:25 -07:00
Kartik K. Agaram d86e8f945b better comment 2023-04-20 23:39:36 -07:00
Kartik K. Agaram e80faa9ab4 include Current_time in reference 2023-04-20 18:42:29 -07:00
Kartik K. Agaram c95bffed88 Merge text0 2023-04-20 18:28:23 -07:00
Kartik K. Agaram 6d86b5268b drop an unused var 2023-04-20 18:27:46 -07:00
Kartik K. Agaram a2451aa26e attempt at better error recovery
- I often find that opening up driver.love and sending any message gets
  my app unwedged. Retrying should be easy. Just press a key.
- There's really no reason for the app to become unresponsive while
  waiting for code changes.

This approach tries to address both. Press any key to retry, or show the
error right on the window while I whip out driver.love. You can also
copy the message to the clipboard by hitting 'c'.

Drawbacks of this approach:
  - nobody's going to read the message. I myself didn't notice the
    default support for copying the error message for _months_.
  - more complexity for anyone reading the code to parse. More stuff
    that can go wrong. Any errors within the handler will crash the app
    hard. (Though now there's less code in the handler, so maybe this is
    an improvement on that score.)

The best plan is still to not rely on this too much. Don't ship bugs.
2023-04-20 00:30:25 -07:00
Kartik K. Agaram 71c82e5c09 document available modes 2023-04-19 23:16:46 -07:00
Kartik K. Agaram ea61f65d00 Merge text0 2023-04-19 22:17:43 -07:00
Kartik K. Agaram e4e881bd41 Merge text.love 2023-04-19 22:17:26 -07:00
Kartik K. Agaram 488f0e4bce Merge lines.love 2023-04-19 22:15:58 -07:00
Kartik K. Agaram 22071c9b71 remove some support for long lines from source editor
A code editor is unlikely to need support for extremely long lines. And
that kind of scroll is jarring anyway in a code editor. We don't read
code like a novel, and less scroll per page implies more scrolling work.

I'd gotten rid of this functionality and the test for it [1] back in the
spokecone fork, but only took out the test when first pulling it into
the source editor.

[1] test_pagedown_often_shows_start_of_wrapping_line
2023-04-19 21:53:11 -07:00
Kartik K. Agaram 5561486cb6 Merge text0 2023-04-19 19:47:42 -07:00
Kartik K. Agaram c95dc559c8 record support for multiple versions 2023-04-19 19:45:17 -07:00
Kartik K. Agaram 991eb3c660 remove a local 2023-04-19 08:34:18 -07:00
Kartik K. Agaram d929b1c1d7 missing definition 2023-04-17 21:10:17 -07:00
Kartik K. Agaram 912ca601ab new file-system format for freewheeling apps
1. No more version history, now we have just the contents of the current
   version.

2. Editing a definition no longer changes the order in which definitions
   load.

This should make repos easier to browse, and more amenable to modify.
You don't need driver.love anymore. And a stable order eliminates some
gotchas. For example:

  using driver.love, define `Foo = 3` in a definition
  define `Bar = Foo + 1`
  edit and redefine `Foo = 4`

Before this commit, you'd get an error when you restart the app.
Definitions used to be loaded in version order, and editing a definition
would move it to the end of the load order, potentially after
definitions using it. I mostly avoided this by keeping top-level
definitions independent. It's fine to refer to any definition inside a
function body, we only need to be careful with initializers for global
variables which run immediately while loading.

After this commit you can still end up in a weird state if you modify a
definition that other later definitions use. In the above example, you
will now see Foo = 4 and Bar = 4. But when you restart, Foo = 4 and Bar
= 5. But that's no more confusing than Emacs's C-x C-e. It's still
a good idea to keep top-level definitions order-independent. It's just
confusing in a similar way to existing tools if you fail to do so. And
your tools won't tend to break as badly.

Why did I ever do my weird version history thing? I think it's my deep
aversion to risking losing any data entered. (Even though the app
currently will seem to lose data in those situations. You'd need to
leave your tools to find the data.) Now I rely on driver.love's undo to
avoid data loss, but once you shut it down you're stuck with what you
have on disk. Or in git.

I also wasn't aware for a long time of any primitives for deleting
files. This might have colored my choices a lot.
2023-04-16 11:16:47 -07:00
Kartik K. Agaram e57ffabf4b make preprocessing more obvious 2023-04-16 11:16:47 -07:00
Kartik K. Agaram b0bcea8f95 some more cleanup after the undo 2023-04-16 11:16:23 -07:00
Kartik K. Agaram 209c380852 undo previous commit 2023-04-15 17:29:55 -07:00
Kartik K. Agaram 02cdf25c1d abortive experiment: keep definitions independent
Functions can refer to each other, but global variable initializers
shouldn't.

But this doesn't work. That comment keeps growing to capture more corner
cases.

Step back. What am I trying to achieve?

I'm not trying to create a better abstraction for programming with. I'm
trying to use an existing abstraction (LÖVE) without needing additional
tools.

I'm not supporting end-user programming, only end-programmer
programming. What happens in a regular LÖVE program if you use a global
before it's defined? You get an error, and you're on the hook to fix it.
But it's obvious what's going on because a file has an obvious sequence
of definitions. But what if you have multiple files? It's easy to lose
track of order and we mostly don't care.

The important property existing dev environments care about: merely
editing a definition doesn't _change_ the order of top-level
definitions. Let's just provide this guarantee.

We'll no longer load definitions in order of their version. Just load
definitions in the order they were created. Editing a definition doesn't
change this order. Deleting and recreating a definition puts it at the
end.
2023-04-15 17:24:11 -07:00
Kartik K. Agaram 6274322412 reorg 2023-04-15 10:14:42 -07:00
Kartik K. Agaram b6cb27ddf2 clarify a comment 2023-04-15 10:12:32 -07:00
Kartik K. Agaram 967950a59f stop printing tests on terminal 2023-04-14 22:38:55 -07:00
Kartik K. Agaram 9b8e651dc7 Merge text0 2023-04-11 21:45:13 -07:00
Kartik K. Agaram d27e22d6fe Merge text.love 2023-04-11 21:44:21 -07:00
Kartik K. Agaram 88caf4eb31 Merge lines.love 2023-04-11 21:41:27 -07:00
Kartik K. Agaram 658f96667b primitives for writing tests 2023-04-11 21:33:33 -07:00
Kartik K. Agaram 4049176dfb couple of typos 2023-04-11 15:15:58 -07:00
Kartik K. Agaram bfd5d61c8a Merge text0 2023-04-10 00:51:25 -07:00
Kartik K. Agaram 7bf8c28561 Merge text.love 2023-04-10 00:50:00 -07:00
Kartik K. Agaram c16998bcc6 Merge lines.love 2023-04-10 00:47:12 -07:00
Kartik K. Agaram ad7cffca27 editor documentation 2023-04-10 00:42:56 -07:00
Kartik K. Agaram 275b707546 rename 2023-04-09 22:31:12 -07:00
Kartik K. Agaram c1b86211cb prevent overriding foundational definitions 2023-04-09 22:29:44 -07:00
Kartik K. Agaram 3f90c92abb Merge text0
This is the original reference for "freewheeling apps".
2023-04-09 21:03:12 -07:00
Kartik K. Agaram 04069f5fc8 Merge text.love 2023-04-09 19:17:23 -07:00
Kartik K. Agaram a0d72ffee2 Merge lines.love 2023-04-09 19:15:07 -07:00