about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Merge lines.loveKartik K. Agaram2023-11-251-1/+8
|\
| * port keyboard layout handling to source editorKartik K. Agaram2023-11-251-1/+8
| |
* | Merge lines.loveKartik K. Agaram2023-11-251-1/+8
|\|
| * improved handling of other keyboard layoutsKartik K. Agaram2023-11-251-1/+8
| |
* | Merge lines.loveKartik K. Agaram2023-11-242-2/+18
|\|
| * bugfix: infinite loop inside a very narrow windowKartik K. Agaram2023-11-242-2/+6
| | | | | | | | | | | | 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.
| * establish a fairly fundamental invariantKartik K. Agaram2023-11-242-0/+12
| | | | | | | | | | | | | | 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.
* | Merge lines.loveKartik K. Agaram2023-11-181-1/+2
|\|
| * late-bind my App.* handlersKartik K. Agaram2023-11-181-1/+2
| | | | | | | | | | | | | | | | This came up when trying to integrate my apps with the vudu debugger (https://github.com/deltadaedalus/vudu). In general, it's a subtle part of LÖVE's semantics that you can modify event handlers any time and your modifications will get picked up. Now my Freewheeling Apps will follow this norm as well.
* | Merge lines.loveKartik K. Agaram2023-11-1814-112/+84
|\|
| * audit all assertsKartik K. Agaram2023-11-1815-132/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge lines.loveKartik K. Agaram2023-11-121-5/+13
|\|
| * remove some dead codeKartik K. Agaram2023-11-121-1/+0
| | | | | | | | We have an early exit for 'error' mode in this function.
| * check for 'error' mode in a few more placesKartik K. Agaram2023-11-121-5/+14
| | | | | | | | | | | | | | In particular, I want to be able to switch to 'error' mode rather than throw a real error() on test failures, because that's a little more responsive and might be recoverable. (On some Android devices the font is slightly different, and tests fail as a result.)
* | Merge lines.loveKartik K. Agaram2023-11-101-3/+2
|\|
| * improve a nameKartik K. Agaram2023-11-101-2/+2
| |
| * clean up a debug printKartik K. Agaram2023-11-101-1/+0
| |
* | Merge lines.loveKartik K. Agaram2023-11-101-1/+22
|\|
| * clean up some cruft from error callstacksKartik K. Agaram2023-11-101-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before: stack traceback: [string "text.lua"]:9: in function 'draw' [string "edit.lua"]:200: in function 'draw' [string "run.lua"]:140: in function 'draw' [string "main.lua"]:162: in function <[string "main.lua"]:155> [C]: in function 'xpcall' [string "app.lua"]:38: in function <[string "app.lua"]:20> [C]: in function 'xpcall' [love "boot.lua"]:370: in function <[love "boot.lua"]:337> after: stack traceback: text.lua:9: in function 'draw' edit.lua:200: in function 'draw' run.lua:140: in function 'draw' main.lua:162: in function <[string "main.lua"]:155> [C]: in function 'xpcall' app.lua:38: in function <[string "app.lua"]:20> [C]: in function 'xpcall' [love "boot.lua"]:370: in function <[love "boot.lua"]:337>
| * remove a no-op regex munging on callstacksKartik K. Agaram2023-11-101-1/+1
| | | | | | | | Port of a fix "upstream": commit b38f172ceb in template-live-editor.
* | Merge lines.loveKartik K. Agaram2023-10-285-9/+13
|\|
| * use my name for a dirKartik K. Agaram2023-10-272-2/+2
| |
| * remove stale variable from docsKartik K. Agaram2023-10-271-1/+1
| |
| * change section delimiters in log for OpenBSDKartik K. Agaram2023-10-202-6/+10
| | | | | | | | Thanks eril for the report and patch.
* | Merge lines.loveKartik K. Agaram2023-10-165-8/+4
|\|
| * use color alpha in button backgroundsKartik K. Agaram2023-10-161-1/+1
| |
| * clearer API for drawing a buttonKartik K. Agaram2023-10-166-9/+5
| | | | | | | | | | | | Make it more obvious that the color passed in is just for the background. The icon will do the rest. r/g/b keys are more consistent with App.color().
* | Merge lines.loveKartik K. Agaram2023-10-151-0/+9
|\|
| * rfind bugfix: handle empty pattern like string.findKartik K. Agaram2023-10-151-0/+2
| |
| * add some tests for rfindKartik K. Agaram2023-10-151-0/+7
| |
* | Merge lines.loveKartik K. Agaram2023-10-095-10/+56
|\|
| * fix all tests in LÖVE v12Kartik K. Agaram2023-10-092-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * start supporting LÖVE v12Kartik K. Agaram2023-10-093-4/+36
| | | | | | | | | | | | | | | | | | | | | | To do this I need some support for multiple versions. And I need an 'error' mode to go with existing 'run' and 'source' modes (`Current_app`). Most errors will automatically transition to 'source' editor mode, but some errors aren't really actionable in the editor. For those we'll use 'error' mode. The app doesn't yet work with LÖVE v12. There are some unit tests failing because of differences in font rendering.
* | Merge lines.loveKartik K. Agaram2023-09-205-26/+102
|\|
| * bugfix: clear selection when clicking above or below linesKartik K. Agaram2023-09-205-26/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 9656e137742). 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.
* | Merge lines.loveKartik K. Agaram2023-09-171-9/+20
|\|
| * indentKartik K. Agaram2023-09-162-16/+16
| |
| * port an old fix to source editorKartik K. Agaram2023-09-161-1/+11
| |
| * bugfix to the helper I added yesterdayKartik K. Agaram2023-09-162-0/+2
| |
* | fix a bad mergeKartik K. Agaram2023-09-161-2/+0
| |
* | Merge lines.loveKartik K. Agaram2023-09-157-29/+40
|\|
| * source: show file being edited in window title barKartik K. Agaram2023-09-152-1/+2
| |
| * delete some dead codeKartik K. Agaram2023-09-152-12/+1
| | | | | | | | This is a holdover from the days of bifold text.
| * hide line numbers from log browserKartik K. Agaram2023-09-153-8/+14
| |
| * assume starty can be nil in updateKartik K. Agaram2023-09-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of a bugfix in pensieve.love. It's not _technically_ a bug here in lines.love, but it seems worth establishing an architectural invariant (or rather lack of invariant). LÖVE's standard event loop performs the following sequence of operations in a single frame: * process events * update * draw Ideally any mutations to global state happen during the first two phases, while drawing includes no mutation. However, there is a special case: `starty`, the top y coordinate for each each line in the editor. This is used all over the place, and the cheapest way to compute it is to simply save it while drawing. However, draw by definition only updates `starty` for lines that are drawn on screen. To avoid stale data on lines off screen, say after scrolling, events often clear `starty` for all lines, leaving it to the next draw phase to repopulate the right lines. Sandwiched between the above two "however"s, the update phase needs to gracefully handle `starty` being nil in the occasional frame right after an event. I think I've audited all our uses of `starty`, and this commit fixes the only place that violates this rule.
| * bugfix: crash when using mouse wheelKartik K. Agaram2023-09-152-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the Text functions assume the cursor is always on a text line. I was violating that invariant. * When scrolling up, I start the cursor at the top-most line below the screen top. * When scrolling down, I start the cursor at the top-most line below the screen bottom. I think it would feel slightly more natural for it to be the bottom-most line above the screen bottom. However, the Text functions maintain an invariant that the bottom-most line in a buffer will be text. There's no such invariant for the top-most line.
| * change a helper slightlyKartik K. Agaram2023-09-152-14/+22
| |
| * clean up a slight jitter when drawing circlesKartik K. Agaram2023-09-151-1/+2
| | | | | | | | | | | | | | | | | | | | Earlier the ghost while drawing wouldn't quite match the final shape. Now the math is identical in draw_pending_shape. It's a little unfortunate that we have this duplication of formulae. At least there are no other stray calls of App.mouse_x in draw_pending_shape.
* | Merge lines.loveKartik K. Agaram2023-09-143-3/+7
|\|
| * always show line numbers in source editorKartik K. Agaram2023-09-143-3/+7
| | | | | | | | | | | | The drawing buttons are now absolutely positioned, which is a horrible hack. But for just the source editor it seems good enough. The alternative is to modify magic constants in all the tests :/