I also really need to rethink how people debug my programs. My approach
of inserting and deleting print() takes a lot of commitment. I need my
old trace-based whitebox testing idea. However, in my past projects I
never did figure out a good framework for tweaking how verbose a trace
to emit.
Perhaps that's too many knobs. Perhaps we just need a way to run a
single test with the most verbose trace possible. Then it's just a
matter of having the trace tell a coherent story? But even if the trace
stays out of program output in that situation, it's still in the
programmer's face in the _code_. Ugh.
Current plan: ship program with maximum tests and zero commented-out
prints. If you want to debug, insert prints. This is better than
previous, text-mode, projects just by virtue of the stdout channel being
dedicated to debug stuff.
I have no fucking idea what I'm doing. All I know is that there's still
too many goddamn bugs[1]. Test motherfucking harness or bust. For
starters this is just the default love.run from
https://love2d.org/wiki/love.run
[1] The following file crashes if you repeatedly press cursor-down:
<<
a
b
c
```lines
```
x
>>
So far I've just changed how existing variables are organized, and put
some scaffolding in place for dealing with the new types. Next up:
rewriting the code for scrolling to something that feels more obviously
correct.
Still lots of signs it's all messed up, but I can't be sure until I
bring all the other keyboard shortcuts in sync.
I just need a better data structure that simplifies the logic. Perhaps
talk in terms of screen lines. In which case:
We'll need to convert lines to screen lines at some point.
We'll need to fix up screen lines when inserting and deleting
characters.
I'd wrapped currx in two conditionals, and not noticed that it gets
reclaimed within the other.
The hint is clearly more work than it's worth. Just take it out.