Commit Graph

1185 Commits

Author SHA1 Message Date
Kartik K. Agaram 661fb53442 don't always pop up keyboard on mobile devices
We don't want to do this during app initialization because other forks
might not start out with an editor on screen even if this one does.

We also don't want to perform side-effects like this within
edit.mouse_press.
2024-09-10 21:28:16 -07:00
Kartik K. Agaram 7b89f058e5 start listing forks again in the Readme 2024-09-09 19:07:41 -07:00
Kartik K. Agaram 129418b81a streamline Readme 2024-09-08 23:14:48 -07:00
Kartik K. Agaram 56093e8d6b update window title 2024-09-08 21:39:00 -07:00
Kartik K. Agaram 62ca1e571d document get_rect 2024-09-08 19:47:32 -07:00
Kartik K. Agaram 5ce83c0d7d support decorations in rects
Just a couple of options for now, but this will enable syntax
highlighting like borders or underlining. (We can't yet color the
characters themselves; perhaps I should have added that first.)
2024-09-08 17:35:00 -07:00
Kartik K. Agaram f84733968b new key in char rects for concealing some characters 2024-09-08 17:35:00 -07:00
Kartik K. Agaram a03aaae527 support a show_cursor key in character rects
This will allow clicking on multiple places to move the cursor to a
particular location. But you can use show_cursor to always show the
cursor in one privileged one of those locations.

Example use case: you want padding around a location. Clicking on the
padding focuses cursor on the location.
2024-09-08 17:35:00 -07:00
Kartik K. Agaram 6ceacf1771 some slight debug infrastructure 2024-09-08 17:04:48 -07:00
Kartik K. Agaram 79ea8759af check both x and y to pick a location
Not strictly needed here, but it does no harm and allows forks to render
characters in other ways besides just left to right.
2024-09-08 17:02:05 -07:00
Kartik K. Agaram c93e01f018 simplify end of file check on right arrow 2024-09-08 16:32:12 -07:00
Kartik K. Agaram f9dc02077c fine, I'll add a badge 2024-09-05 14:31:52 -07:00
Kartik K. Agaram 7b2ef048d2 fix line wrap in a comment 2024-09-03 15:24:53 -07:00
Kartik K. Agaram a88af01eef Merge branch 'yumaikas-experiment'
After using get_rect in edit.draw I grow more confident that this is a
better approach. The only drawback is that I.loc_up and
I.loc_up_whole_screen_lines need some extra work to fight the
abstraction of get_rect. But that feels like a net win.
2024-09-01 18:24:30 -07:00
Kartik K. Agaram eb6da10e93 reuse get_rect in edit.draw 2024-09-01 18:21:35 -07:00
Kartik K. Agaram e7062b401f slightly reorg a comment 2024-09-01 07:42:12 -07:00
Kartik K. Agaram e3511b8a3f bugfix: initial run without settings
Thanks @drbulbul on the LÖVE Discord for the bug report.
2024-09-01 07:42:12 -07:00
Kartik K. Agaram 97d24c5b1d run some initialization exactly once 2024-09-01 07:42:12 -07:00
Kartik K. Agaram ea9757c984 delete a stale comment 2024-09-01 07:42:12 -07:00
Kartik K. Agaram 1793153343 slightly reorg a comment 2024-09-01 07:34:47 -07:00
Kartik K. Agaram b994e92162 bugfix: initial run without settings
Thanks @drbulbul on the LÖVE Discord for the bug report.
2024-09-01 07:32:06 -07:00
Kartik K. Agaram 716937502d run some initialization exactly once 2024-09-01 07:30:54 -07:00
Kartik K. Agaram 3ce47fa94c delete a stale comment 2024-09-01 07:30:24 -07:00
Kartik K. Agaram 4ad9a3cf1a bugfix: resize 2024-09-01 00:15:29 -07:00
Kartik K. Agaram 3cf5c06bcd bugfix: resize 2024-09-01 00:14:53 -07:00
Kartik K. Agaram 93b3c80372 collapse into one file with 0 global vars 2024-08-31 23:44:07 -07:00
Kartik K. Agaram 852d1a89fa collapse into one file with 0 global vars 2024-08-31 23:33:26 -07:00
Kartik K. Agaram c9333ef103 Merge lines2.love 2024-08-31 19:27:45 -07:00
Kartik K. Agaram 414f86d945 Merge lines2.love 2024-08-31 19:25:25 -07:00
Kartik K. Agaram 3720f8a875 clean up an issue I feel confident about 2024-08-31 19:17:56 -07:00
Kartik K. Agaram 6c71be2e56 clean up an issue I feel confident about 2024-08-31 19:17:32 -07:00
Kartik K. Agaram 008ab3df6c rename 2024-08-31 19:06:09 -07:00
Kartik K. Agaram afff83fa84 rename 2024-08-31 19:05:58 -07:00
Kartik K. Agaram d75603da7e explicitly state when operations manage undo 2024-08-31 19:03:29 -07:00
Kartik K. Agaram 2f2eeff1dd explicitly state when operations manage undo 2024-08-31 19:01:33 -07:00
Kartik K. Agaram 04ca57c326 make function arg lowercase
This might have introduced a bug. I _think_ I've checked for functions
without an `Editor` arg, but one may have slipped past. I don't know how
to be sure. (Not without tests :/)
2024-08-31 18:50:52 -07:00
Kartik K. Agaram 95837a50f6 make function arg lowercase
This might have introduced a bug. I _think_ I've checked for functions
without an `Editor` arg, but one may have slipped past. I don't know how
to be sure. (Not without tests :/)
2024-08-31 18:48:40 -07:00
Kartik K. Agaram c1995daa10 Merge lines2.love 2024-08-31 18:43:41 -07:00
Kartik K. Agaram 63a7147778 Merge lines2.love 2024-08-31 18:42:20 -07:00
Kartik K. Agaram cd34c94a4a bugfix
scenario:
  start with an empty file, there's one line with a '+' button on it
  press the '+' to create a drawing in the top line
  press C-z to undo
  = before this commit, undo would create a weird intermediate state where there were two lines with '+' on them

scenario:
  type something into the first line, press enter to append a second line
  press the '+' on the second line to create a drawing
  press C-z to undo
  = crash

The root cause in both cases: we end up creating 2 undo events starting
from the same before snapshot: one inside the button handler, and a
second on mouse release.

This doesn't affect lines 1 because we had a separate variable called
current_drawing which protected the mouse release handler from
triggering.
2024-08-31 18:32:52 -07:00
Kartik K. Agaram 5ce18bdf6d bugfix
scenario:
  start with an empty file, there's one line with a '+' button on it
  press the '+' to create a drawing in the top line
  press C-z to undo
  = before this commit, undo would create a weird intermediate state where there were two lines with '+' on them

scenario:
  type something into the first line, press enter to append a second line
  press the '+' on the second line to create a drawing
  press C-z to undo
  = crash

The root cause in both cases: we end up creating 2 undo events starting
from the same before snapshot: one inside the button handler, and a
second on mouse release.

This doesn't affect lines 1 because we had a separate variable called
current_drawing which protected the mouse release handler from
triggering.
2024-08-31 18:28:48 -07:00
Kartik K. Agaram 73f5b9632f bugfix
scenario:
* open a file with a drawing on the first line
* position cursor in the line below
* hit backspace

I _think_ this is the only place where I need to update screen_top
_before_ the scroll check (because screen_top switches mode and has
gotten corrupted).
2024-08-31 17:55:23 -07:00
Kartik K. Agaram 48a0e0e59d bugfix
scenario:
* open a file with a drawing on the first line
* position cursor in the line below
* hit backspace

I _think_ this is the only place where I need to update screen_top
_before_ the scroll check (because screen_top switches mode and has
gotten corrupted).
2024-08-31 17:53:19 -07:00
Kartik K. Agaram 477e0c72f1 Merge lines2.love 2024-08-30 00:51:07 -07:00
Kartik K. Agaram 52ec86655f Merge lines2.love 2024-08-30 00:49:55 -07:00
Kartik K. Agaram 074978f4e0 bugfix 2024-08-30 00:48:42 -07:00
Kartik K. Agaram cc12ef92c4 bugfix 2024-08-30 00:48:33 -07:00
Kartik K. Agaram b6bf7d526d clean up a few stale comments 2024-08-30 00:47:26 -07:00
Kartik K. Agaram b7a911a7cc clean up a few stale comments 2024-08-30 00:47:04 -07:00
Kartik K. Agaram db4feccedd Merge lines2.love 2024-08-28 21:23:19 -07:00