Commit Graph

975 Commits

Author SHA1 Message Date
Kartik K. Agaram 8b5fdffd7d quite the frustrating bugfix 2022-05-23 15:34:05 -07:00
Kartik K. Agaram c9434e4f17 snapshot
Why the fuck is this so fucking hard?
2022-05-23 15:22:16 -07:00
Kartik K. Agaram 254ae7ad99 . 2022-05-23 13:18:34 -07:00
Kartik K. Agaram 4490c5034f similar tests for cursor up 2022-05-23 11:02:37 -07:00
Kartik K. Agaram e0b2c2dede couple of tests for cursor down 2022-05-23 10:56:39 -07:00
Kartik K. Agaram 4f6a324975 bugfix: don't rely on Screen_bottom1 while scrolling
Setting up the test just right to test the thing I want to test was a
rube goldberg machine of constants.
2022-05-23 08:52:13 -07:00
Kartik K. Agaram 37f1313b16 first successful pagedown test, first bug found by test
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.
2022-05-23 08:17:40 -07:00
Kartik K. Agaram 46d4c4de10 first test! 2022-05-22 23:17:06 -07:00
Kartik K. Agaram 8aa72be226 fold variables for screen dimensions into the app framework 2022-05-22 18:45:21 -07:00
Kartik K. Agaram 5d0e0f70c4 one more implication 2022-05-22 18:32:08 -07:00
Kartik K. Agaram f421e1daa5 basic test-enabled framework
Tests still have a lot of side-effects on the real screen. We'll
gradually clean those up.
2022-05-22 18:29:52 -07:00
Kartik K. Agaram 555726a87d rename 2022-05-22 18:23:04 -07:00
Kartik K. Agaram f1eba43ed3 yet another bugfix. But for how long? 2022-05-22 10:40:34 -07:00
Kartik K. Agaram ac74592c42 beginnings of a test harness
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
  >>
2022-05-22 10:40:34 -07:00
Kartik K. Agaram 5b9d8337c1 up and down arrow now moving by screen line where possible
Drawings can't be drawn partially, which sometimes makes things jerky.
2022-05-21 23:02:08 -07:00
Kartik K. Agaram 84898ed43a bugfix: printing the first part of a line at the bottom made it seem non-wrapping
Still lots wrong here.
2022-05-21 22:32:43 -07:00
Kartik K. Agaram 96dfe4f669 cleaner 2022-05-21 21:08:21 -07:00
Kartik K. Agaram 1e63bf0e0a I feel confident now that page-down is working. 2022-05-21 20:52:44 -07:00
Kartik K. Agaram 6550a4c6d7 couple of TODOs 2022-05-21 16:42:22 -07:00
Kartik K. Agaram c0df6f86a4 beginning of a new approach to scroll+wrap
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.
2022-05-21 16:42:22 -07:00
Kartik K. Agaram 9a18b09de3 bugfix: escape key to hide online help 2022-05-21 14:22:34 -07:00
Kartik K. Agaram a70d9a81dc help tweak 2022-05-21 14:20:16 -07:00
Kartik K. Agaram 0537f81744 show when we're naming a point 2022-05-21 14:18:31 -07:00
Kartik K. Agaram bb9e23a638 support for naming points
There's still an absence of affordance showing when you're in naming mode.
2022-05-21 14:03:06 -07:00
Kartik K. Agaram 96df187488 new known issue with drawings 2022-05-21 10:36:27 -07:00
Kartik K. Agaram 77ba9433d7 one missing transition between shape modes 2022-05-21 09:30:02 -07:00
Kartik K. Agaram 5d8e7a3cc6 several bugfixes
All introduced when I built rectangles and squares in commit e27165cb.
2022-05-21 08:41:54 -07:00
Kartik K. Agaram 10c961855a bugfix: rectangles and squares are now saved 2022-05-21 08:28:34 -07:00
Kartik K. Agaram f42c3f8181 bugfix
Looks like I never retested rectangles after I implemented drawing
squares, even though I made changes to the rectangle implementation :/
2022-05-21 08:20:55 -07:00
Kartik K. Agaram 95e17dac2f bugfix: missed rename in one file 2022-05-21 08:10:11 -07:00
Kartik K. Agaram da250585c0 disable some debug prints
I'm still very much in the region where this is valuable sensor data.
This is a new domain.
2022-05-20 22:46:32 -07:00
Kartik K. Agaram 0773b986dd more precise height calculation when scrolling up as much as possible while keeping cursor on screen 2022-05-20 22:45:49 -07:00
Kartik K. Agaram e420245ee3 keep cursor on screen when pressing 'down' 2022-05-20 22:18:39 -07:00
Kartik K. Agaram e3dc4c330b rename 2022-05-20 22:17:47 -07:00
Kartik K. Agaram a3f72abbde reduce ambitions a bit: page up/down need not start screen from the middle of a line
But we still have work to do for cursor up/down.
2022-05-20 21:30:59 -07:00
Kartik K. Agaram 6b91c0688e first stab at equally hacky cursor down support 2022-05-20 20:33:30 -07:00
Kartik K. Agaram ec5706e1ea stop recomputing Cursor_x now that we're saving it 2022-05-20 20:32:55 -07:00
Kartik K. Agaram e223df41bc clearer comments 2022-05-20 20:32:00 -07:00
Kartik K. Agaram 5d139f4327 ensure Filename is writable when opened outside a terminal
Thanks Jimmy Miller for reporting this.
2022-05-20 20:11:00 -07:00
Kartik K. Agaram 7d9125b0b0 some more logging
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.
2022-05-20 18:16:13 -07:00
Kartik K. Agaram c28f6ba031 snapshot - no, that's all wrong
I've been only thinking about up arrow when cursor is at top of screen.
Hopefully this is better.
2022-05-20 16:56:04 -07:00
Kartik K. Agaram ce94f8bf79 another piece of support for line wrapping in cursor up 2022-05-20 15:19:43 -07:00
Kartik K. Agaram 7e6705a113 first stab at supporting wrapping in cursor up
Looks pretty clean.
2022-05-20 08:55:45 -07:00
Kartik K. Agaram 1c20d514f2 bugfix
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.
2022-05-20 08:02:03 -07:00
Kartik K. Agaram 3ec8019cc0 new globals: draw partial screen line up top
I'm not setting these yet. Rendering seems to be working after manually
setting them.
2022-05-20 06:58:17 -07:00
Kartik K. Agaram 1573dd8425 start using some globals 2022-05-20 06:10:04 -07:00
Kartik K. Agaram 05ac4a5057 move 2022-05-20 06:00:20 -07:00
Kartik K. Agaram bca0c1fab9 bugfix 2022-05-20 05:44:04 -07:00
Kartik K. Agaram 7fd3c92efe start remembering where the cursor is drawn in px
We'll start using this in cursor up/down motions.
2022-05-20 05:41:25 -07:00
Kartik K. Agaram 5f2ef2faaf extract a function 2022-05-20 05:40:42 -07:00