Commit Graph

1145 Commits

Author SHA1 Message Date
Kartik K. Agaram 9bbfc2be13 crisp font rendering 2022-06-02 23:36:07 -07:00
Kartik K. Agaram b94b007db5 find text 2022-06-02 22:53:34 -07:00
Kartik K. Agaram 63f59e7c2c scroll if necessary on paste 2022-06-02 19:28:38 -07:00
Kartik K. Agaram 15c54f4383 rename 2022-06-02 19:25:33 -07:00
Kartik K. Agaram 9121a263a6 . 2022-06-02 19:08:06 -07:00
Kartik K. Agaram 51f4f13ecc test harness now supports copy/paste 2022-06-02 18:52:49 -07:00
Kartik K. Agaram 283c4e5804 bugfix: pasting newlines 2022-06-02 18:35:18 -07:00
Kartik K. Agaram 4f76ea37d7 more efficient undo/redo
Now the bottleneck shifts to applying undo/redo in large files. But
things should be snappy if you don't use the sluggish feature.
2022-06-02 17:46:30 -07:00
Kartik K. Agaram 22817492a3 rename 2022-06-02 16:44:18 -07:00
Kartik K. Agaram 477216a051 this implementation undo load-tests quite poorly
Even a 10KB file gets sluggish within the first 1k characters inserted.

We're not running out of memory, we're just overloading Lua's GC.
2022-06-02 16:29:18 -07:00
Kartik K. Agaram b4e76eac4e bugfix: undo drawing creation
Also clean up drawing state to make sure we don't get into hard-to-debug
situations.
2022-06-02 15:51:44 -07:00
Kartik K. Agaram 670886240f after much struggle, a brute-force undo
Incredibly inefficient, but I don't yet know how to efficiently encode
undo mutations that can span multiple lines.

There seems to be one bug related to creating new drawings; they're not
spawning events and undoing past drawing creation has some weird
artifacts. Redo seems to consistently work, though.
2022-06-02 15:45:25 -07:00
Kartik K. Agaram a9a133e6fb update some App framework docs 2022-05-31 17:29:58 -07:00
Kartik K. Agaram 819cb4b1cc avoid scrolling down if possible 2022-05-30 17:24:23 -07:00
Kartik K. Agaram d0d22fffbc missing temporary modes in a couple more places 2022-05-30 16:23:08 -07:00
Kartik K. Agaram 69eeefe197 missing shape modes in a couple more places 2022-05-30 16:23:01 -07:00
Kartik K. Agaram b22bfe82db support non-text lines in Text.to2
Originally I was only using it on cursor line, but there's no reason
that has to be true in general.
2022-05-30 15:40:36 -07:00
Kartik K. Agaram 3b4dacaee8 regression: typing uppercase letters in text 2022-05-30 15:36:53 -07:00
Kartik K. Agaram fd5a47f8bf more robust transitions to temporary modes
I seem to often accidentally press C-n twice to go into name mode. Now
doing so overrides the previous temporary mode (name/move/delete point)
without clobbering the real shape-drawing mode.
2022-05-30 15:34:53 -07:00
Kartik K. Agaram 714f7d11cd experiment: give up on changing shape mode
I often find myself accidentally hovering over some shape or other when
switching modes.

One additional reason to do this: I never included it in the help. So it
hasn't been very high-priority.
2022-05-30 15:34:01 -07:00
Kartik K. Agaram 3414f0a11d bugfix: function names 2022-05-30 15:29:57 -07:00
Kartik K. Agaram 096f6255b2 ignore 'name' mode in a few places 2022-05-30 15:28:50 -07:00
Kartik K. Agaram 1552efd76d bugfix: checking if a point is on a manhattan line 2022-05-30 15:27:03 -07:00
Kartik K. Agaram 26033f40f1 ignore 'deleted' shapes when saving to disk 2022-05-30 15:26:31 -07:00
Kartik K. Agaram 53def098e1 Readme 2022-05-29 17:03:01 -07:00
Kartik K. Agaram a603847d18 go through App in a couple more places 2022-05-29 16:37:31 -07:00
Kartik K. Agaram 5b95e51c36 . 2022-05-29 16:34:36 -07:00
Kartik K. Agaram d441f8a760 some helpers
I spent some time trying to reduce the duplication between identical
operations with and without the shift key pressed. However it makes
things harder to understand. If you try to process selection in
App.keychord_pressed in main.lua, you have to sometimes process the
selection before (e.g. including the state of the cursor _before_ an
arrow key takes effect), and sometimes after (e.g. copying the selection
before resetting it, even though it doesn't include a shift key)

Let's just leave things as they are.
2022-05-29 16:13:24 -07:00
Kartik K. Agaram 6aeb89386c . 2022-05-29 16:03:02 -07:00
Kartik K. Agaram f17f5a1192 cut/copy selected text to clipboard 2022-05-29 15:33:24 -07:00
Kartik K. Agaram 23e9be3e10 selecting text and deleting selections
I've written a few tests for delete_selection, but the way different
operations initialize the selection seems fairly standard and not worth
testing so far.
2022-05-29 08:12:47 -07:00
Kartik K. Agaram 524157fb8a bugfix for non-ASCII 2022-05-29 07:57:35 -07:00
Kartik K. Agaram 2b69b71c7a update some documentation 2022-05-29 07:56:55 -07:00
Kartik K. Agaram b0bb105cbe extract a couple of methods 2022-05-28 23:11:53 -07:00
Kartik K. Agaram a6ab7a2c20 bugfix: include shift keys in modifier_down 2022-05-28 23:01:01 -07:00
Kartik K. Agaram d58aabe867 extract a couple more methods 2022-05-28 22:45:53 -07:00
Kartik K. Agaram 86532eef4b move some code
I had this idea originally to keep text.lua oblivious to drawings.
But that hasn't been true for some time. Losing battle.
2022-05-28 22:45:08 -07:00
Kartik K. Agaram 18c62fb146 extract a few methods 2022-05-28 22:38:35 -07:00
Kartik K. Agaram e79c895c7d move 2022-05-28 22:27:47 -07:00
Kartik K. Agaram 10c1a70dd0 . 2022-05-28 22:24:17 -07:00
Kartik K. Agaram 916e4ce341 scroll on backspace 2022-05-28 09:41:02 -07:00
Kartik K. Agaram cf94d36a5f . 2022-05-28 09:35:06 -07:00
Kartik K. Agaram 95592b83fb . 2022-05-28 09:31:51 -07:00
Kartik K. Agaram 3266262b1f fix a regression in line wrapping 2022-05-28 09:04:21 -07:00
Kartik K. Agaram 8a3b66c813 scroll on enter 2022-05-28 08:38:49 -07:00
Kartik K. Agaram 229e1514f2 . 2022-05-27 23:35:01 -07:00
Kartik K. Agaram f4235a1741 tweak modifier keys to include 'shift' 2022-05-27 23:34:20 -07:00
Kartik K. Agaram 0fab1b499d paste in text with M-v 2022-05-26 20:40:50 -07:00
Kartik K. Agaram dd635546e3 . 2022-05-25 21:04:27 -07:00
Kartik K. Agaram bce43b56b0 few more transitions between shapes 2022-05-25 17:07:19 -07:00