Commit Graph

1140 Commits

Author SHA1 Message Date
Kartik K. Agaram a0d72ffee2 Merge lines.love 2023-04-09 19:15:07 -07:00
Kartik K. Agaram d61ccafaa0 include a brief reference enabling many useful apps 2023-04-09 19:09:31 -07:00
Kartik K. Agaram 0d913ba8f1 Merge lines.love 2023-04-09 14:14:03 -07:00
Kartik K. Agaram 4b43e9e85d deemphasize the source editor
This repo does not support freewheeling modification. It's a primitive
to enable freewheeling modification in downstream forks.

The source editor is a convenience, but it's a sharp tool and can easily
leave the app in a broken state that requires dropping down to external
tools (editor, file manager) to fix.
2023-04-09 11:12:36 -07:00
Kartik K. Agaram b3a3321cd6 Merge lines.love 2023-04-08 22:57:01 -07:00
Kartik K. Agaram 25e7eb99a9 rename a variable 2023-04-08 22:44:13 -07:00
Kartik K. Agaram 6a7c5824c3 bugfix: syntax highlighting in source editor
I missed that comments only get highlighted at start of line.

This seems a bit hacky. But it continues to trade off CPU for reduced
memory footprint.
2023-04-08 22:28:19 -07:00
Kartik K. Agaram 7e242db523 Merge lines.love 2023-04-08 22:01:01 -07:00
Kartik K. Agaram c969fcdd85 enhance bugfix of commit a9aa3436f (Dec 2024)
Scenario:
* start out with some text on screen
* select some text A, delete
* select some more text B, delete
* press C-z twice to restore A and B
* press C-y twice

Before this commit only the first C-y was having an effect (deleting B).
The second was failing to delete A.
2023-04-08 21:55:51 -07:00
Kartik K. Agaram e406fdae0d Merge lines.love 2023-04-03 09:23:28 -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 95342345a8 change cursor bounds check slightly
This doesn't affect this fork directly, but it's a bad idea to assume
the _app_ is always going to be doing just what a particular subsystem
(here, the text editor in edit.lua+text.lua) is doing.
2023-04-02 17:24:02 -07:00
Kartik K. Agaram 384fb2d19c streamline the interface for Text.draw 2023-04-02 17:19:03 -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 d0d39797cf show count of test failures 2023-04-01 20:40:47 -07:00
Kartik K. Agaram af239935ce minor cleanup and a todo for later 2023-04-01 20:40:47 -07:00
Kartik K. Agaram 86517606a1 clean up some final bifold code 2023-04-01 20:39:53 -07:00
Kartik K. Agaram c87e4a3bab start thinking of compute_fragments as a detail
I think all we need to maintain is the populate_screen_line_starting_pos
array. It's easy to render screen lines one by one from it, and we'll
only ever construct one additional screen line at a time.

I'd hoped to delete other calls to Text.populate_screen_line_starting_pos,
but it turns out we need to update it when editing sometimes. Give up on
that for now; it's a no-op if not needed.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram 24a732ebff update documentation on fragments
I see a path to at least maintain a single fragment per screen line. But
can we do better? It even seems unnecessary to maintain two copies of
the data, chopped up into lines and screen lines.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram ed27b8dd85 stop creating a singleton table for every word 2023-04-01 18:12:29 -07:00
Kartik K. Agaram fbc8b85bcf clean up some debug prints
It's starting to become apparent just how little line_cache.fragments
does for me now. Let's see if we can get rid of it entirely.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram f64f680f2b no more Text allocations
Is it just my imagination, or does the app feel lighter and more fluffy?
2023-04-01 18:12:29 -07:00
Kartik K. Agaram 876d6298b4 App.width can no longer take a Text
In the process I discovered the horrible fact that Text.x allocates a new Text.
And it gets called (just once, thank goodness) on every single frame.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram 4ab901c92e get rid of to_text
I've been misunderstanding what Text objects are. They can render a lot
of text with a given line height, word wrap, colors in various places.
And I've been creating one for every word 🤦

Unwinding this will take some time. This is just a first baby step for
ad hoc text objects. Turns out I don't need to convert to Text to get
something's rendered width, just the Font can do that.

Thanks to the LÖVE Discord for educating me:
  https://discord.com/channels/329400828920070144/330089431379869708/1091535487333826580
2023-04-01 16:12:55 -07:00
Kartik K. Agaram 3bdaf97baa Merge lines.love 2023-03-30 23:15:06 -07:00
Kartik K. Agaram fd2e5acb46 . 2023-03-30 23:12:23 -07:00
Kartik K. Agaram 4c601ce9fd Merge lines.love 2023-03-30 23:12:01 -07:00
Kartik K. Agaram 563f22116c obsolete manual test 2023-03-30 23:03:55 -07:00
Kartik K. Agaram 5b2e629622 better formatting 2023-03-28 22:01:51 -07:00
Kartik K. Agaram 0aa69d831d Merge lines.love 2023-03-26 09:57:49 -07:00
Kartik K. Agaram a3e5a1f22d update stale source X-( 2023-03-26 09:55:02 -07:00
Kartik K. Agaram 46e568c4c5 Merge lines.love 2023-03-26 09:49:03 -07:00
Kartik K. Agaram eae5c9505c bugfix: naming points 2023-03-26 09:36:41 -07:00
Kartik K. Agaram 0ae94b0de5 bugfix 2023-03-26 08:19:40 -07:00
Kartik K. Agaram 7f433753b6 bugfix
scenario: open a file starting with a drawing
After this commit the program doesn't crash.

  Error: [string "edit.lua"]:127: attempt to get length of field 'data' (a nil value)
  stack traceback:
    [love "boot.lua"]:345: in function '__len'
    [string "edit.lua"]:127: in function 'invalid1'
    [string "edit.lua"]:116: in function 'check_locs'
    [string "run.lua"]:35: in function 'initialize'
    main.lua:96: in function 'initialize'
    [string "app.lua"]:144: in function 'run_tests_and_initialize'
    [string "app.lua"]:16: in function <[string "app.lua"]:13>
    [C]: in function 'xpcall'
    [love "boot.lua"]:361: in function <[love "boot.lua"]:348>
    [C]: in function 'xpcall'
2023-03-26 07:19:27 -07:00
Kartik K. Agaram 9fff5b7132 Merge lines.love 2023-03-25 21:56:14 -07:00
Kartik K. Agaram 57ed70d912 clean up some absolute coordinates 2023-03-25 18:34:28 -07:00
Kartik K. Agaram cf4451dc1b Merge lines.love 2023-03-25 17:23:57 -07:00
Kartik K. Agaram da932ce92d update stale information 2023-03-25 17:19:28 -07:00
Kartik K. Agaram eba85af0e3 Merge lines.love 2023-03-25 12:44:19 -07:00
Kartik K. Agaram 1bd2846ec2 Merge lines.love 2023-03-25 11:30:25 -07:00
Kartik K. Agaram afadb4db66 stop reusing cursor locations between files 2023-03-25 10:37:55 -07:00
Kartik K. Agaram 0b1c47f79f experiment at avoiding some merge conflicts
https://merveilles.town/@akkartik/110084833821965708
2023-03-25 10:36:43 -07:00
Kartik K. Agaram aa8994167f Merge lines.love 2023-03-23 21:43:26 -07:00
Kartik K. Agaram a6dcfc5ac8 some minor cleanup
I can't see the mouse wheel ever setting dx, but it's more obvious now
that the editor doesn't support panning left/right.
2023-03-23 21:38:33 -07:00
Kartik K. Agaram 99faf61abb mouse wheel support 2023-03-23 21:00:09 -07:00
Kartik K. Agaram 75dfd3fd62 Merge lines.love 2023-03-21 00:13:40 -07:00
Kartik K. Agaram 609f0b2fc8 mention a new tool 2023-03-21 00:10:20 -07:00
Kartik K. Agaram dc0ad458c9 Merge lines.love 2023-03-19 11:52:10 -07:00