Commit Graph

86 Commits

Author SHA1 Message Date
Kartik K. Agaram 4854165630 Merge lines.love 2022-12-23 19:47:10 -08:00
Kartik K. Agaram e0448d7d7f consistent names in a few more places 2022-12-23 19:32:58 -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 e2e3aea2b1 require editor margins to be ints
Not directly relevant here, but forks of this project that permit
zooming can run into weird glitches if margins are not a whole number of
pixels.

I'd always assumed a type system that divided ints into floats was
strictly superior, but now I have experienced a situation where
requiring ints isn't just a compromise for the underlying CPU
implementation. Particularly since Lua's print() silently hides really
tiny fractions.
2022-12-23 16:57:04 -08:00
Kartik K. Agaram 92eccaea5a bugfix in changing shape mid-stroke 2022-12-12 23:17:02 -08:00
Kartik K. Agaram 3897a9d86d Merge lines.love 2022-12-12 22:45:16 -08:00
Kartik K. Agaram 8b30e0608b bugfix: naming points in drawings
We had a regression since commit 60e1023f0 on Nov 27. Turns out we do
need the ancient hack after all.

But no, we won't go back to the hack. It's a simple problem to fix
right. And while we're at it, we'll fix the test harness to be more
realistic so it would have caught this problem.
2022-12-12 22:31:45 -08:00
Kartik K. Agaram 5283c16e5c Merge lines.love 2022-11-27 22:22:16 -08:00
Kartik K. Agaram 7557e0904a bugfix 2022-11-27 22:20:26 -08:00
Kartik K. Agaram 356fed8a24 Merge lines.love 2022-11-19 00:28:37 -08:00
Kartik K. Agaram 44aa8226c4 ctrl+a: select entire buffer 2022-11-19 00:27:20 -08:00
Kartik K. Agaram 79fd6c4464 purge unused button infrastructure 2022-11-05 19:52:42 -07:00
Kartik K. Agaram fd71bc7d94 Merge lines.love 2022-11-03 21:08:11 -07:00
Kartik K. Agaram 0e0f36f8b4 stop tracking wallclock time
We only need time differences.
2022-11-03 21:02:31 -07:00
Kartik K. Agaram b23269f3e0 Merge lines.love 2022-09-10 19:25:00 -07:00
Kartik K. Agaram 511db8cffd bugfix: path munging on Windows 2022-09-10 19:23:34 -07:00
Kartik K. Agaram 901dd1fd94 Merge lines.love 2022-09-07 10:19:16 -07:00
Kartik K. Agaram 06c784b576 self-documenting 0 Test_right_margin 2022-09-07 10:16:24 -07:00
Kartik K. Agaram e0f750913f Merge lines.love 2022-09-05 12:47:27 -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
Kartik K. Agaram 42762ce062 editing source code from within the app
integrated from pong.love: https://merveilles.town/@akkartik/108933336531898243
2022-09-03 13:58:30 -07:00
Kartik K. Agaram 89081a8a78 Merge lines.love 2022-08-24 13:34:10 -07:00
Kartik K. Agaram ce31b74b10 infrastructure for caching LÖVE text objects 2022-08-24 13:27:04 -07:00
Kartik K. Agaram d011c0ce32 Merge lines.love 2022-08-23 13:25:55 -07:00
Kartik K. Agaram 468b791050 flip return value of button handlers
This is compatible with Javascript, and it also seems like a better
default; when people forget to think about return values in click
handlers, they should be consumed.
2022-08-23 11:43:10 -07:00
Kartik K. Agaram 8057f3e8fe stop putting button state in a global
Symptom: a test (test_click_to_create_drawing) started randomly failing
after I inserted a `return` 2 commits ago.

Cause: my tests call edit.draw, but button handlers only get cleared in
app.draw. So my tests weren't clearing button handlers, and every call
to edit.draw was accumulating states. Still unclear why those were going
to different state objects after the `return`, but anyway. I'm not going
to understand every last thing that happens when things go wrong, just
guarantee they can't go wrong. And the way to do that is to decentralize
button handlers to each state that receives them.

The State object in buttons.lua doesn't have to be Editor_state. It just
has to be some table that provides a Schelling Point for shared state.
2022-08-23 10:59:58 -07:00
Kartik K. Agaram aadc50f3b6 allow buttons to interrupt events
Most button onpress1 handlers will want to return true.
2022-08-23 09:40:48 -07:00
Kartik K. Agaram cfdac28e18 distinguish consistently between mouse buttons and other buttons 2022-08-23 09:36:08 -07:00
Kartik K. Agaram 61b59f4dd6 Merge lines.love 2022-08-18 13:11:41 -07:00
Kartik K. Agaram 3c04310503 subsection headings in a long switch 2022-08-18 10:09:20 -07:00
Kartik K. Agaram 03f3034930 Merge lines.love 2022-08-17 09:51:17 -07:00
Kartik K. Agaram f029c710b5 simplify cursor-on-screen check 2022-08-17 09:36:17 -07:00
Kartik K. Agaram a655c2113c bring back a level of wrapping
Many projects will require the ability to add metadata to lines, so
let's not drop that.
2022-08-15 11:00:35 -07:00
Kartik K. Agaram a85b984021 clean up a few more loose ends 2022-08-14 09:53:16 -07:00
Kartik K. Agaram 9d792a203b new fork: rip out drawing support 2022-08-14 09:20:14 -07:00
Kartik K. Agaram 9459d91abc remove some duplication 2022-08-14 08:10:24 -07:00
Kartik K. Agaram 4d1e7f922d bugfix: obsolete location for attribute 2022-08-14 07:56:12 -07:00
Kartik K. Agaram 0218980add click to the left of a line 2022-07-29 14:38:45 -07:00
Kartik K. Agaram 1e6b9e25aa copying to clipboard can never scroll 2022-07-27 20:51:18 -07:00
Kartik K. Agaram 4ce716fe44 line.y -> line_cache.starty in a few more places
Disquieting that none of my tests caught these. On the other hand, I
also haven't noticed any issues in practice. Perhaps cache invalidation
is often unnecessary.
2022-07-27 20:45:46 -07:00
Kartik K. Agaram 48162b9816 have file API operate on state object 2022-07-25 19:56:39 -07:00
Kartik K. Agaram 6f74f95a46 extract method 2022-07-23 23:36:04 -07:00
Kartik K. Agaram 1937379da3 move drawing.starty into line cache 2022-07-20 17:08:00 -07:00
Kartik K. Agaram d61b5dfdeb use line cache for drawings as well 2022-07-20 16:34:09 -07:00
Kartik K. Agaram 29dac6a6ec separate data structure for each line's cache data
I have no idea what the performance implications of this are..
2022-07-17 21:05:01 -07:00
Kartik K. Agaram 64eed74980 keep all text cache writes inside text.lua 2022-07-17 10:06:39 -07:00
Kartik K. Agaram 2859063d9d switch to line index in a function
- Text.to_pos_on_line
2022-07-17 09:19:53 -07:00
Kartik K. Agaram 48b7de4fde switch to line index in a function
- Text.in_line
2022-07-17 09:14:10 -07:00
Kartik K. Agaram c0ea369607 drop some extra args 2022-07-17 09:14:10 -07:00