Kartik K. Agaram
f544131d00
Merge text0
2023-01-20 22:47:52 -08:00
Kartik K. Agaram
486afb1c68
Merge lines.love
2023-01-20 22:08:39 -08:00
Kartik K. Agaram
2a0a770c49
deduce test names on failures
2023-01-20 21:48:49 -08:00
Kartik K. Agaram
ea6db20022
Merge text0
2022-12-23 20:54:40 -08:00
Kartik K. Agaram
e9a517161b
Merge lines.love
2022-12-23 20:46:31 -08:00
Kartik K. Agaram
8b9dab0c36
overzealous search-and-replace
2022-12-23 20:42:12 -08:00
Kartik K. Agaram
45032ebbbe
Merge text0
2022-12-23 20:17:16 -08:00
Kartik K. Agaram
4854165630
Merge lines.love
2022-12-23 19:47:10 -08:00
Kartik K. Agaram
2b3e09ca0f
make love event names consistent
...
I want the words to be easy to read, and to use a consistent tense.
update and focus seem more timeless; let's make everything like those.
2022-12-23 18:52:28 -08:00
Kartik K. Agaram
df0aec10d0
streamline one more test name
2022-12-13 09:50:36 -08:00
Kartik K. Agaram
03be29885f
more streamlined test names
...
https://lobste.rs/messages/e1rimy
2022-12-13 09:43:55 -08:00
Kartik K. Agaram
2dd2b16295
remove a duplicate test
2022-12-13 09:05:31 -08:00
Kartik K. Agaram
833ef32db1
configurable colors and cursor in editor widget
2022-11-30 19:31:00 -08:00
Kartik K. Agaram
a655c2113c
bring back a level of wrapping
...
Many projects will require the ability to add metadata to lines, so
let's not drop that.
2022-08-15 11:00:35 -07:00
Kartik K. Agaram
9d792a203b
new fork: rip out drawing support
2022-08-14 09:20:14 -07:00
Kartik K. Agaram
f3df1cda0f
bugfix: check after cursor on same line when searching upwards
2022-08-11 22:23:16 -07:00
Kartik K. Agaram
e85a7e73d0
bugfix: search upwards
2022-08-11 22:23:16 -07:00
Kartik K. Agaram
0afd03e721
bugfix: check before cursor on same line
2022-08-11 22:23:16 -07:00
Kartik K. Agaram
da34fabf72
bugfix: pagedown was sometimes bouncing up
2022-08-10 22:56:10 -07:00
Kartik K. Agaram
ba48aadaa7
bugfix: backspace from start of final line
2022-08-10 22:38:10 -07:00
Kartik K. Agaram
0218980add
click to the left of a line
2022-07-29 14:38:45 -07:00
Kartik K. Agaram
4ce716fe44
line.y -> line_cache.starty in a few more places
...
Disquieting that none of my tests caught these. On the other hand, I
also haven't noticed any issues in practice. Perhaps cache invalidation
is often unnecessary.
2022-07-27 20:45:46 -07:00
Kartik K. Agaram
3265abacb4
bugfix: skip over drawings when searching
2022-07-25 09:49:26 -07:00
Kartik K. Agaram
0251b3f0c2
bugfix: search
...
Broken since commit 188bbc73
9 days ago :/ At least we have a test for
it now.
2022-07-21 16:55:05 -07:00
Kartik K. Agaram
e2734cd572
bugfix: where cursor is drawn
...
The published version of lines.love was broken for almost an hour. The
cursor would render one position to the right of where it really is. To
fix it, this commit rolls back 26ba6e4e5a
. There doesn't seem a good
way to test it.
2022-07-20 09:11:29 -07:00
Kartik K. Agaram
9f4b41d829
exclude left margin from my word-split heuristic
...
Gratifying how few tests need changing. Recent commits seem on the right
track.
2022-07-20 07:15:46 -07:00
Kartik K. Agaram
a472d218f2
allow Text.nearest_pos_less_than to return 0
...
This eliminates another case of overflowing margins.
2022-07-20 07:08:28 -07:00
Kartik K. Agaram
26ba6e4e5a
unify two similar functions
...
The cost is just having to tweak a few more brittle tests. I can't
actually perceive any difference in how the cursor moves when I click on
text.
2022-07-19 17:13:16 -07:00
Kartik K. Agaram
efd4a8a883
keep text from overflowing right margin
...
I've been sloppy about this so far, and outside of tests I can't find
any examples where it matters, but it matters in a potential fork where
I'm rendering multiple columns of text.
It's unfortunate that my tests have this level of brittleness. What I'd
really like to assert in many of these changed lines is that the text
stays inside the margins and that more text would overflow margins.
2022-07-19 16:49:08 -07:00
Kartik K. Agaram
cc5ab51c53
delete some duplicate initialization
2022-07-19 08:04:21 -07:00
Kartik K. Agaram
82cdd9ddd1
bugfix: couple of margin-relative computations
2022-07-17 22:29:37 -07:00
Kartik K. Agaram
29dac6a6ec
separate data structure for each line's cache data
...
I have no idea what the performance implications of this are..
2022-07-17 21:05:01 -07:00
Kartik K. Agaram
f61d4269f5
bring back a set of constants
...
It's starting to sink in that I don't want hard-coded constants inside
objects.
2022-07-16 08:48:02 -07:00
Kartik K. Agaram
c26b377ab3
more decoupling editor tests from App
2022-07-16 08:33:05 -07:00
Kartik K. Agaram
a2b654b534
more decoupling editor tests from App
2022-07-16 08:27:11 -07:00
Kartik K. Agaram
2884f872d8
make test initializations a little more obvious
2022-07-15 22:12:25 -07:00
Kartik K. Agaram
3b36093553
left/right margin -> left/right coordinates
...
Editor state initialization now depends on window dimensions, so we have
to more carefully orchestrate startup.
2022-07-12 20:54:50 -07:00
Kartik K. Agaram
92ad99853e
call edit rather than App callbacks in tests
2022-07-12 15:41:17 -07:00
Kartik K. Agaram
81ecca89ff
start passing in Editor_state explicitly
...
In this commit, top-level edit functions:
- edit.draw
- edit.update
- edit.quit
- edit.mouse_pressed
- edit.mouse_released
- edit.textinput
- edit.keychord_pressed
- edit.key_released
2022-07-12 15:33:06 -07:00
Kartik K. Agaram
e95b4fec12
initialize contains test state
2022-07-12 15:29:22 -07:00
Kartik K. Agaram
8bbc1ffe34
group all editor globals
...
We're still accessing them through a global. But we'll change that next.
2022-07-12 15:24:56 -07:00
Kartik K. Agaram
9b49c8da77
start decoupling editor tests from App
2022-07-11 23:18:26 -07:00
Kartik K. Agaram
6c4483976e
skip multiple consecutive whitespace
2022-07-11 19:18:54 -07:00
Kartik K. Agaram
bc2c14c899
support other whitespace chars in word movements
2022-07-11 18:56:19 -07:00
Kartik K. Agaram
92e572fc89
flesh out some tests for word movements
2022-07-11 18:46:49 -07:00
Kartik K. Agaram
6dfe954c02
yet another bugfix in selection management
...
Thanks Leonard Schütz for the report!
Failing scenario:
click to move cursor
hit backspace
First backspace wasn't being doing anything earlier.
2022-07-07 07:39:01 -07:00
Kartik K. Agaram
914d9c6f98
bugfix: clicking on empty lines
2022-07-01 12:16:43 -07:00
Kartik K. Agaram
429a42eb1c
right margin
2022-06-30 22:54:34 -07:00
Kartik K. Agaram
8c7bea8f76
rip out notion of Line_width
2022-06-30 19:50:27 -07:00
Kartik K. Agaram
510b0d1dc3
bugfix: lines that aren't drawn from the start
...
I can't believe I didn't catch this until now. All I had to do is open
MobyDick.markdown from https://www.hogbaysoftware.com/posts/moby-dick-workout ,
press page-down and click on the top screen line (or any screen line
containing the same line as the top screen line). Easy to catch with any
file containing lots of overly long lines, as happens in particular at
the start of Moby Dick.
I _had_ seen this problem before, but it seemed to disappear after
unrelated changes, and I convinced myself I'd fixed it as a side-effect.
The bug just failed to manifest if the top line happened to start at the
top of the screen. Scroll down a few pages in Moby Dick and the dialogue
starts and line length drops precipitously.
2022-06-30 18:14:48 -07:00