Commit Graph

19 Commits

Author SHA1 Message Date
Kartik K. Agaram 4e9298dda1 bugfix in cursor positioning
scenario:
- create a long wrapping line
- tap past end of first screen line

Before this commit the cursor would be positioned not quite at the end
of the screen line but one character before. In effect there was no way
to position cursor at end of a wrapping line.

I'm not sure how this bug has lasted so long. It was introduced in
commit 8d3adfa36 back in June 2022, which was itself billed as a bugfix
for "clicking past end of screen line". But when I go back to it this
bug exists even back then. How did I miss it?! I wrote a test back then
-- and the test was wrong, has always been wrong.
2024-02-08 02:37:12 -08:00
Kartik K. Agaram 1d1a829d5b more carefully pass the 'key' arg around 2024-02-04 09:30:48 -08:00
Kartik K. Agaram c29be0ffce streamline button.lua 2023-12-16 23:41:10 -08:00
Kartik K. Agaram 69d86cae5b fix all tests in LÖVE v12
This is all quite hacky. Many of my tests are unfortunately brittle to
changes in text rendering. Fortunately there's only one test that
currently requires a hacky special case (and a second test I tweaked
slightly to be more robust).

I can't think of a better approach. It doesn't help to standardize the
font, because version changes still come with changes to text-shaping
algorithms even if the font itself is unchanged. I could base all my
assertions on the widths of individual characters, but that would make
the tests much less readable and not express intent as clearly. So here
we are, with hopefully just a few hacky special cases (there might be a
few more as LÖVE v12 advances towards publication, and in further
versions).
2023-10-09 20:25:08 -07:00
Kartik K. Agaram bd6f7d48e7 bugfix: clear selection when clicking above or below lines
Matt Wynne pointed out that snap.love would crash when a node went off
screen. While debugging it I noticed that selection1 was being set when
it shouldn't be.

Turns out I introduced a bug when I fixed the inscript bug back in June
(commit 9656e13774). One invariant I want to preserve is: selection1
should be unset after a mouse click (press and release without
intervening drag). This invariant was violated in my bugfix back in
June. I was concerned only with selection back then, and I didn't
realize I was breaking the mouse click case (in a fairly subtle way; you
can have selection set, and when it's set identically to the cursor
everything looks the same).

I think there might still be an issue in snap.love after this fix. I
noticed screen_bottom1.pos was nil, and as far as I recall that should
never happen.
2023-09-20 13:39:29 -07:00
Kartik K. Agaram 637e28f300 port inscript's bugfix to source editor 2023-06-04 12:33:23 -07:00
Kartik K. Agaram 8e02c2c021 bugfix: searching files containing unicode
Before this change the cursor was moving, but not being highlighted
properly when the cursor line contained unicode before the cursor.
2023-05-13 17:02:10 -07:00
Kartik K. Agaram 282983d084 switch source side to new screen-line-based render
Also copy over the implementation of links from pensieve.love.
2023-04-03 08:33:07 -07:00
Kartik K. Agaram 0c06c60622 give a test a unique name 2023-03-19 11:48:47 -07:00
Kartik K. Agaram 675d1cbbdf bugfix
Thanks Mikoláš Štrajt.
2023-03-17 21:52:35 -07:00
Kartik K. Agaram 33ad6b7e5b bugfix: up arrow when line above is a drawing
This bug was introduced in commit 528c64d690 on 2022-09-05 :/
2023-01-31 22:39:04 -08:00
Kartik K. Agaram 2a0a770c49 deduce test names on failures 2023-01-20 21:48:49 -08:00
Kartik K. Agaram 8b9dab0c36 overzealous search-and-replace 2022-12-23 20:42:12 -08:00
Kartik K. Agaram 2b3e09ca0f make love event names consistent
I want the words to be easy to read, and to use a consistent tense.
update and focus seem more timeless; let's make everything like those.
2022-12-23 18:52:28 -08:00
Kartik K. Agaram df0aec10d0 streamline one more test name 2022-12-13 09:50:36 -08:00
Kartik K. Agaram b0ce6156ec repeat changes on source editor 2022-12-13 09:45:57 -08:00
Kartik K. Agaram 73fefa7d09 support selections in the source editor
I've only tested side A so far, and included a statement of how I want
side B to behave.
2022-09-06 10:05:20 -07:00
Kartik K. Agaram 528c64d690 support drawings in the source editor 2022-09-05 11:29:39 -07:00
Kartik K. Agaram e1c5a42f31 editing source code from within the app
integrated from pong.love via text.love:
  https://merveilles.town/@akkartik/108933336531898243
2022-09-03 14:13:22 -07:00