Commit Graph

984 Commits

Author SHA1 Message Date
Kartik K. Agaram
f0e967d2a1 flesh out Readme 2022-06-06 18:33:44 -07:00
Kartik K. Agaram
8780276f0c another known issue 2022-06-06 17:30:03 -07:00
Kartik K. Agaram
612e08571f autosave on cut/paste 2022-06-05 12:55:36 -07:00
Kartik K. Agaram
b1c7ebdca3 additional logging for an active bug 2022-06-05 12:04:21 -07:00
Kartik K. Agaram
a70d7ba8bc . 2022-06-05 10:30:23 -07:00
Kartik K. Agaram
d043745ccd record another known issue I don't know how to fix yet
Perhaps I need to switch to the next more sophisticated data structure for Lines:
a gap buffer around the line the cursor is on.

I'm not sure why it would help here, though.
2022-06-05 10:28:42 -07:00
Kartik K. Agaram
9cafed99f4 another bugfix in scrolling while inserting text
I'm being unprincipled at the moment between pos and x,y coordinates.
Whatever is more convenient. Perhaps a cleaner approach will come to me
over time.
2022-06-05 10:08:28 -07:00
Kartik K. Agaram
e7a985bd0a bugfix in previous commit
I almost pushed this to production. That would have been catastrophic;
the very first keystroke anyone typed into the editor would have failed.

And in the process, this fixes the next bug on my TODO list! Paste on
first line wasn't working. Now it is.
2022-06-05 09:51:54 -07:00
Kartik K. Agaram
de473046bc check for scroll when just typing 2022-06-05 08:29:38 -07:00
Kartik K. Agaram
5055361209 rename 2022-06-05 08:11:50 -07:00
Kartik K. Agaram
3f07ac51d2 some unnecessary mutations
Why are we not modifying Screen_top1.pos in these places? Because we
don't really need to modify Screen_top1 at all.
2022-06-05 08:11:33 -07:00
Kartik K. Agaram
8c0f54ee64 some typos 2022-06-05 07:59:44 -07:00
Kartik K. Agaram
6267ddd2eb bugfix: backspace from start of file 2022-06-04 22:13:34 -07:00
Kartik K. Agaram
778bc78416 make online help fit within a drawing 2022-06-04 21:58:06 -07:00
Kartik K. Agaram
7d1671051f yet another key conflict 2022-06-04 21:48:35 -07:00
Kartik K. Agaram
4c5ac9ae5e regression: couldn't do many drawing operations because line.y was reset 2022-06-04 20:52:36 -07:00
Kartik K. Agaram
db8b5b5062 switch circles to 'o' to avoid conflicting with copy 2022-06-04 20:35:31 -07:00
Kartik K. Agaram
bfaa3fd95b bugfix in help 2022-06-04 20:25:48 -07:00
Kartik K. Agaram
9ee5d1c913 try to maintain a reasonable line width 2022-06-04 20:10:56 -07:00
Kartik K. Agaram
557b91a5de . 2022-06-04 19:38:20 -07:00
Kartik K. Agaram
fa267e25e6 experiment: slightly adaptive scrolling
When long wrapping lines go past the current page, I find myself
scrolling before I get to the bottom. So let's scroll less, usually from
the start of the bottom-most line, even if it wraps multiple screen
lines.

The challenge with this is to ensure that a long line that fills the
whole page by itself doesn't get you stuck. I take some care to make
sure <pagedown> always makes forward progress.
2022-06-04 14:55:52 -07:00
Kartik K. Agaram
1326914d7b select text with shift + mouseclick
It's still a bit simple-minded. Most software will keep the first bound
fixed and move the second. Lines currently has the bounds in a queue of
sorts. But I have a test to indicate the behavior that is definitely
desired. We'll see if we need it to get more complex.
2022-06-04 14:54:40 -07:00
Kartik K. Agaram
98f50f0b40 make cursor more obvious
Let's see if this is good enough. I can also bump up to 4px radius if I
need to.
2022-06-04 11:46:43 -07:00
Kartik K. Agaram
a4cec2f58a one more known issue 2022-06-03 14:42:08 -07:00
Kartik K. Agaram
e2696fcc72 more precise search highlighting 2022-06-03 14:37:32 -07:00
Kartik K. Agaram
1bdb931575 extract a function 2022-06-03 14:30:51 -07:00
Kartik K. Agaram
0d52962b3e extract a couple of files 2022-06-03 14:17:41 -07:00
Kartik K. Agaram
06e6ecdf8f bugfix: restore state after C-f (find) 2022-06-03 13:59:40 -07:00
Kartik K. Agaram
ac83252684 taking stock
couple of more temporary bugs:
  find sometimes draws highlighted text in wrong place
  esc after C-f sometimes ends up with cursor before screen top

But the known issues are harder.
2022-06-03 13:32:42 -07:00
Kartik K. Agaram
b69801bdf1 highlight selection while dragging
Mouse stuff is pretty strenuous. For the first time I have to be careful
not to recompute too often. And I ran into a race condition for the
first time where resetting line.y within App.draw meant mouse clicks
were extremely unlikely to see line.y set.
2022-06-03 13:22:03 -07:00
Kartik K. Agaram
73cc12047e select text using mouse drag
Doesn't yet highlight while dragging.
2022-06-03 08:11:18 -07:00
Kartik K. Agaram
9efeae1f82 rename 2022-06-03 08:01:21 -07:00
Kartik K. Agaram
91d79eba33 local var 2022-06-03 08:00:31 -07:00
Kartik K. Agaram
7301f3964c up arrow to search previous 2022-06-03 07:48:41 -07:00
Kartik K. Agaram
03499f7449 switch freehand hotkey to eliminate conflict with search
I'm now following Inkscape, and the mnemonic is 'pencil'.
2022-06-02 23:55:17 -07:00
Kartik K. Agaram
8047ab9b89 switch copy/paste to ctrl- hotkeys 2022-06-02 23:52:26 -07:00
Kartik K. Agaram
dcdcd07902 switch undo/redo to ctrl- hotkeys 2022-06-02 23:48:35 -07:00
Kartik K. Agaram
1fc4214029 default font size and line-height 2022-06-02 23:44:34 -07:00
Kartik K. Agaram
0b63721bb0 extract a new variable 2022-06-02 23:40:20 -07:00
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