Commit Graph

1152 Commits

Author SHA1 Message Date
Kartik K. Agaram 284dfe616f 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:25:36 -07:00
Kartik K. Agaram 2f51b693af streamline Readme 2024-09-08 23:13:50 -07:00
Kartik K. Agaram 0bd43b931b simplify end of file check on right arrow 2024-09-08 16:37:17 -07:00
Kartik K. Agaram 1c81f15237 fine, I'll add a badge 2024-09-05 14:30:52 -07:00
Kartik K. Agaram ff04771be0 fix line wrap in a comment 2024-09-03 15:23:41 -07:00
Kartik K. Agaram 64a4282ffd 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 edit.up and
edit._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 19:55:35 -07:00
Kartik K. Agaram 0078f0a757 reuse get_rect in edit.draw 2024-09-01 19:54:26 -07:00
Kartik K. Agaram 6e17b2ea1a stale hack 2024-08-31 19:44:12 -07:00
Kartik K. Agaram df76d50d19 stale hack 2024-08-31 19:43:44 -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 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 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 e2a3b0eda0 fix a stupid bug 2024-08-28 20:23:14 -07:00
Kartik K. Agaram 9879a059ff fix a stupid bug 2024-08-28 20:22:00 -07:00
Kartik K. Agaram 7ae717aeae implicitly compute line_height from font_height 2024-08-28 17:58:16 -07:00
Kartik K. Agaram 28ad0eb8e7 implicitly compute line_height from font_height 2024-08-28 17:58:05 -07:00
Kartik K. Agaram 54242d9d07 bugfix: don't process most keys if cursor is out of view
I think the only situation this can happen is after pressing C-a to
select a file (that doesn't fit on screen). But it's important for
potential forks, e.g. positioning editors on infinite surfaces.
2024-08-28 17:55:27 -07:00
Kartik K. Agaram 34546e15ca bugfix: don't process most keys if cursor is out of view
I think the only situation this can happen is after pressing C-a to
select a file (that doesn't fit on screen). But it's important for
potential forks, e.g. positioning editors on infinite surfaces.
2024-08-28 17:52:13 -07:00
Kartik K. Agaram 00d9169bda bugfix: move/delete/name operations on points 2024-08-18 11:20:14 -07:00
Kartik K. Agaram a6b9cd94be bugfix: move/delete/name operations on points 2024-08-18 11:18:38 -07:00
Kartik K. Agaram d5ae54c2ec bugfix: check for no point at mouse 2024-08-18 11:00:47 -07:00
Kartik K. Agaram 91c1463cb1 bugfix: check for no point at mouse 2024-08-18 11:00:08 -07:00
Kartik K. Agaram 76df6e5dd6 bugfix: switch screen_top mode when clicking on drawing
I suspect select.lua and search.lua may not be checking for drawings
everywhere they should.
2024-08-18 10:49:06 -07:00
Kartik K. Agaram 9a2bb73df8 recent changes to Readme 2024-08-18 10:48:57 -07:00
Kartik K. Agaram ad2493ffaf bugfix: switch screen_top mode when clicking on drawing
I suspect select.lua and search.lua may not be checking for drawings
everywhere they should.
2024-08-18 10:47:54 -07:00
Kartik K. Agaram fcddbef26f bugfix: use additional space when resizing window 2024-08-18 10:19:31 -07:00
Kartik K. Agaram 692663b884 fixup! bugfix: stale function name 2024-08-18 10:16:53 -07:00
Kartik K. Agaram ff422b9773 update the goal
This fork has no tests; intended more to freeze durably than to add features to.
2024-07-28 22:50:19 -07:00
Kartik K. Agaram f50b968106 clean up stale issues 2024-07-28 22:30:23 -07:00
Kartik K. Agaram aad21bd9a1 bugfix: reduce error in edit.hor
Cursor no longer drifts left as you repeatedly press up/down arrow
within a region of filled screen lines.
2024-07-28 20:25:48 -07:00
Kartik K. Agaram 1fe8a2dc4a bugfix: reduce error in edit.hor
Cursor no longer drifts left as you repeatedly press up/down arrow
within a region of filled screen lines.
2024-07-28 20:20:16 -07:00
Kartik K. Agaram 0193ad7d18 bugfix: positioning cursor on first screen line of line 2024-07-28 20:13:05 -07:00
Kartik K. Agaram 2a8b48fcec get rid of debug UI 2024-07-28 19:48:33 -07:00
Kartik K. Agaram 0215156e4c bugfix: edit.get_rect is now in sync with edit.draw
I fixed 1 bug in edit.draw and 4 bugs in the debug UI :)
2024-07-28 19:45:57 -07:00
Kartik K. Agaram 31dd8aa7c6 debug UI shows draw_rects is out of sync with edit.draw 2024-07-28 19:33:21 -07:00
Kartik K. Agaram ce1b60a2e6 hoist some code within edit.get_rect 2024-07-28 19:18:44 -07:00
Kartik K. Agaram cf7bff30f7 stop returning unused value 2024-07-28 19:10:41 -07:00