Commit Graph

133 Commits

Author SHA1 Message Date
Kartik K. Agaram 243c873542 Merge template-live-editor 2024-02-08 03:04:33 -08:00
Kartik K. Agaram 7740beab74 Merge text0 2024-02-08 02:58:10 -08:00
Kartik K. Agaram 6b33c9e223 Merge lines.love 2024-02-08 02:52:55 -08:00
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 a93454d938 Merge template-live-editor 2024-02-04 17:55:50 -08:00
Kartik K. Agaram e3124760b1 Merge text0 2024-02-04 17:45:48 -08:00
Kartik K. Agaram 77e1b57446 Merge lines.love 2024-02-04 17:36:01 -08:00
Kartik K. Agaram 1d1a829d5b more carefully pass the 'key' arg around 2024-02-04 09:30:48 -08:00
Kartik K. Agaram 27d069d148 Merge template-live-editor 2023-12-17 00:13:20 -08:00
Kartik K. Agaram 031586f3dc merge bugfix 2023-12-17 00:09:25 -08:00
Kartik K. Agaram dd2c6c34f9 Merge template-live-editor 2023-12-17 00:00:26 -08:00
Kartik K. Agaram cd3af059c0 Merge text0 2023-12-16 23:56:20 -08:00
Kartik K. Agaram aa4d80f157 Merge lines.love 2023-12-16 23:49:20 -08:00
Kartik K. Agaram c29be0ffce streamline button.lua 2023-12-16 23:41:10 -08:00
Kartik K. Agaram 8950257a15 Merge template-live-editor 2023-10-09 21:21:44 -07:00
Kartik K. Agaram 8d50a56eb7 Merge text0 2023-10-09 21:15:21 -07:00
Kartik K. Agaram b84cbf6d21 Merge lines.love 2023-10-09 20:55:24 -07: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 fb5fa4abd3 Merge template-live-editor 2023-09-20 16:42:48 -07:00
Kartik K. Agaram 6aae154734 merge bugfix 2023-09-20 16:40:20 -07:00
Kartik K. Agaram 77ae46a728 Merge template-live-editor 2023-09-20 14:55:12 -07:00
Kartik K. Agaram 4e7538d05e Merge text0 2023-09-20 14:52:31 -07:00
Kartik K. Agaram 3aec915559 Merge lines.love 2023-09-20 14:32:01 -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 b8d5e24834 Merge template-live-editor 2023-06-04 15:45:08 -07:00
Kartik K. Agaram 44e3cdcdb7 Merge text0 2023-06-04 15:34:49 -07:00
Kartik K. Agaram bf2c2555d6 Merge lines.love 2023-06-04 15:11:24 -07:00
Kartik K. Agaram 9656e13774 bugfix: inscript's bug
To fix this I have to first stop incrementally updating screen_bottom1
in the middle of a frame. Now it always has a good value from the end of
a frame.

I'm also running into some limitations in the test I'd ideally like to
write (that are documented in a comment), but I still get some sort of
automated test for this bugfix.
2023-06-04 12:20:24 -07:00
Kartik K. Agaram cf0ba7c154 handle wrapping lines 2023-06-03 10:44:11 -07:00
Kartik K. Agaram 3114176ebd change how we handle clicks above top margin 2023-06-03 10:36:05 -07:00
Kartik K. Agaram cdef37c419 get rid of recent_mouse
It's a hack:
  - if you start selecting from below final line the start of the
    selection is the most recent click even if it was forever ago
  - (the crash we're currently fixing) if you start up and immediately
    select all then click below final line => crash. recent_mouse was
    never set.
  - getting rid of it breaks no tests (except the crash we're currently
    fixing)
2023-06-01 22:12:12 -07:00
Kartik K. Agaram 9b27a4d816 failing test now looks realistic 2023-06-01 21:59:09 -07:00
Kartik K. Agaram 9c0e534fca Merge template-live-editor 2023-05-13 17:36:00 -07:00
Kartik K. Agaram 348ef3064e Merge text0 2023-05-13 17:34:55 -07:00
Kartik K. Agaram 10932bd491 Merge lines.love 2023-05-13 17:29:45 -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 ceb9a543b7 get rid of an old special-case in this fork
I find scrolling less than a screenful useful in the presence of long
lines, but here we're already stitching one page in common each time we
scroll.
2023-04-19 21:21:49 -07:00
Kartik K. Agaram 38c5014761 Merge text0 2023-04-02 16:50:08 -07:00
Kartik K. Agaram 3547c18db6 Merge lines.love 2023-04-02 09:22:32 -07:00
Kartik K. Agaram 29f1687f3c avoid saving fragments in lines
Now we render lines one screen line at a time rather than one word at a
time.

I can't port the source side just yet; I need to fix hyperlinks first..
2023-04-01 21:44:27 -07:00
Kartik K. Agaram 06fb3c4bfe Merge text0 2023-03-19 11:54:53 -07:00
Kartik K. Agaram dc0ad458c9 Merge lines.love 2023-03-19 11:52:10 -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 f544131d00 Merge text0 2023-01-20 22:47:52 -08:00
Kartik K. Agaram 486afb1c68 Merge lines.love 2023-01-20 22:08:39 -08:00
Kartik K. Agaram 2a0a770c49 deduce test names on failures 2023-01-20 21:48:49 -08:00
Kartik K. Agaram ea6db20022 Merge text0 2022-12-23 20:54:40 -08:00
Kartik K. Agaram e9a517161b Merge lines.love 2022-12-23 20:46:31 -08:00