Commit Graph

367 Commits

Author SHA1 Message Date
Kartik K. Agaram 83881938f5 Merge text0 2024-01-15 02:33:22 -08:00
Kartik K. Agaram 51eea67bf4 Merge text.love 2024-01-15 02:31:01 -08:00
Kartik K. Agaram 348852ee2b Merge lines.love 2024-01-15 01:38:38 -08:00
Kartik K. Agaram 95d88a8298 use editor state font for width calculations 2024-01-12 05:23:06 -08:00
Kartik K. Agaram b0da9c5f6a Merge text0 2023-12-26 11:35:07 -08:00
Kartik K. Agaram 2275149f74 Merge text.love 2023-12-26 11:34:02 -08:00
Kartik K. Agaram 2b1c48c08e Merge lines.love 2023-12-26 11:29:52 -08:00
Kartik K. Agaram e36559d264 bugfix: utf-8 2023-12-26 11:19:23 -08:00
Kartik K. Agaram 7dfe8000bb Merge text0 2023-12-09 10:07:10 -08:00
Kartik K. Agaram c33b70efd0 Merge text.love 2023-12-09 10:06:37 -08:00
Kartik K. Agaram 67e3a43b52 Merge lines.love 2023-12-09 09:59:09 -08:00
Kartik K. Agaram 961f296131 fix a couple of asserts missed in the recent audit 2023-12-09 09:22:45 -08:00
Kartik K. Agaram 7fa185dc99 Merge text0 2023-11-25 16:10:10 -08:00
Kartik K. Agaram a143125743 Merge text.love 2023-11-25 16:09:24 -08:00
Kartik K. Agaram aed0eb592a Merge lines.love 2023-11-25 15:27:12 -08:00
Kartik K. Agaram f6420efd90 improved handling of other keyboard layouts 2023-11-25 15:20:55 -08:00
Kartik K. Agaram dbc0c1fe28 Merge text0 2023-11-24 19:41:06 -08:00
Kartik K. Agaram 7618023da2 Merge text.love 2023-11-24 19:40:14 -08:00
Kartik K. Agaram 5561ebf06f Merge lines.love 2023-11-24 19:36:26 -08:00
Kartik K. Agaram c1f7f17f9c bugfix: infinite loop inside a very narrow window
I'm not sure this can trigger everywhere (I've only been able to
exercise it in Lua Carousel), but it seems like a safety net worth
having against future modifications by anybody.
2023-11-24 19:19:29 -08:00
Kartik K. Agaram 0751b38932 establish a fairly fundamental invariant
This commit doesn't guarantee we'll always catch it. But if this
invariant is violated, things can get quite difficult to debug. I found
in the Lua Carousel fork that all the xpcalls I keep around were
actively hindering my ability to notice this invariant being violated.
2023-11-24 19:16:33 -08:00
Kartik K. Agaram 61f95a349b Merge text0 2023-11-18 12:53:21 -08:00
Kartik K. Agaram c3effcc850 Merge text.love 2023-11-18 12:49:34 -08:00
Kartik K. Agaram de66b015bc Merge lines.love 2023-11-18 12:21:30 -08:00
Kartik K. Agaram 007b965b11 audit all asserts
Each one should provide a message that will show up within LÖVE. Stop
relying on nearby prints to the terminal.

I also found some unnecessary ones.

There is some potential here for performance regressions: the format()
calls will trigger whether or not the assertion fails, and cause
allocations. So far Lua's GC seems good enough to manage the load even
with Moby Dick, even in some situations that caused issues in the past
like undo.
2023-11-18 11:32:01 -08:00
Kartik K. Agaram 3865fd86cd delete an unused arg 2023-07-31 14:20:53 -07:00
Kartik K. Agaram 6a644f3e44 bugfix: render text in given fg color 2023-07-31 12:01:18 -07:00
Kartik K. Agaram 47dd4a6785 Merge text0 2023-07-31 11:08:52 -07:00
Kartik K. Agaram e8a90c616d Merge text.love 2023-07-31 10:59:28 -07:00
Kartik K. Agaram 3b88c6540d Merge lines.love 2023-07-31 10:26:19 -07:00
Kartik K. Agaram bb3e12eb5f bugfix: search highlight straddling screen lines 2023-07-31 09:15:48 -07:00
Kartik K. Agaram 2b52383e18 remove a duplicate print to screen
In addition to being more efficient, this will simplify the next bugfix.
2023-07-31 08:56:20 -07:00
Kartik K. Agaram 8879fd6f29 extract a variable 2023-07-31 08:49:24 -07:00
Kartik K. Agaram d6c06db97a bugfix: highlight search patterns on the right line
scenario:
* position a wrapped line on screen
* search for the word immediately after the point of wrapping

Before this commit the word would be highlighted twice:
  - at the end of the first screen line
  - at the start of the second screen line

Now it shows up at the right place.
2023-07-31 08:40:22 -07:00
Kartik K. Agaram f7f42b0bef hoist and duplicate a conditional
I'm duplicating the bounds check when drawing cursor and search
highlight because they're separate concerns and require subtly different
logic.
2023-07-31 08:40:07 -07:00
Kartik K. Agaram 484b76f5c6 improve a comment 2023-07-31 08:21:38 -07:00
Kartik K. Agaram 60f26a9a4f experiment: knob for readonly editor 2023-06-07 22:23:10 -07:00
Kartik K. Agaram 44e3cdcdb7 Merge text0 2023-06-04 15:34:49 -07:00
Kartik K. Agaram 484602bd9e Merge text.love 2023-06-04 15:25:46 -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 47d39b43b3 Merge text0 2023-05-14 17:34:21 -07:00
Kartik K. Agaram c78345acf0 Merge text.love 2023-05-14 17:34:03 -07:00
Kartik K. Agaram 0f3841f186 Merge lines.love 2023-05-14 17:31:55 -07:00
Kartik K. Agaram c96be4b007 add an assert
I added this to catch a rare bug. I've had it locally for a few weeks
now without hitting it. Doesn't hurt to publish it.
2023-05-14 17:23:08 -07:00
Kartik K. Agaram f17dd5ec46 Merge text0 2023-05-06 09:15:14 -07:00
Kartik K. Agaram f2896ab40b Merge text.love 2023-05-06 09:14:51 -07:00
Kartik K. Agaram e39fe490e4 Merge lines.love 2023-05-06 09:09:48 -07:00
Kartik K. Agaram 6a1d8e5164 bugfix: never use utf8 pos in string.sub
This is a violation of an existing rule in Manual_tests.md. The
following command weakly suggests there aren't any others:
  grep ':sub(' *.lua |grep pos
2023-05-06 08:56:44 -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