Kartik K. Agaram
8c373fdb60
get rid of all bifold text
...
It's just uneconomic to maintain given how little I've used it. I have a
bug right now and no time to port the bugfix to all the complexities of
the B side.
I briefly considered tossing out the entire source editor. But I _have_
been using it to browse logs across sessions. The live editor doesn't
quite cover all my use cases just yet.
We now have duplication in the source editor only for:
* syntax highlighting
* hyperlinking [[WikiWords]]
* ability to hide cursor (when showing file browser or Focus is in log browser)
2023-03-17 21:48:29 -07:00
Kartik K. Agaram
0b38fa2689
Merge text0
2023-01-31 22:54:38 -08:00
Kartik K. Agaram
55634d45ee
Merge text.love
2023-01-31 22:54:09 -08:00
Kartik K. Agaram
60f3ded88d
Merge lines.love
2023-01-31 22:48:44 -08:00
Kartik K. Agaram
33ad6b7e5b
bugfix: up arrow when line above is a drawing
...
This bug was introduced in commit 528c64d690
on 2022-09-05 :/
2023-01-31 22:39:04 -08:00
Kartik K. Agaram
f120fb2449
Merge text0
2023-01-13 09:49:29 -08:00
Kartik K. Agaram
e80f48506d
Merge text.love
2023-01-13 09:48:20 -08:00
Kartik K. Agaram
d8ec259711
Merge lines.love
2023-01-13 09:33:34 -08:00
Kartik K. Agaram
22bf3da7de
reduce use of rfind
2023-01-13 09:10:48 -08:00
Kartik K. Agaram
b4fff66a56
a prefix for metadata in the manifest
2023-01-02 18:21:55 -08:00
Kartik K. Agaram
45032ebbbe
Merge text0
2022-12-23 20:17:16 -08:00
Kartik K. Agaram
98add5023f
Merge text.love
2022-12-23 20:11:51 -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
833ef32db1
configurable colors and cursor in editor widget
2022-11-30 19:31:00 -08:00
Kartik K. Agaram
b64a60a509
bring back everything from commit a68647ae22
...
We only want to unwind the source editing.
2022-11-06 08:53:46 -08:00
Kartik K. Agaram
29140d24be
back to commit 8123959e52
without code editing
2022-11-03 21:45:25 -07:00
Kartik K. Agaram
7e3dc2bc34
Merge lines.love
2022-09-06 18:46:07 -07:00
Kartik K. Agaram
73fefa7d09
support selections in the source editor
...
I've only tested side A so far, and included a statement of how I want
side B to behave.
2022-09-06 10:05:20 -07:00
Kartik K. Agaram
e0f750913f
Merge lines.love
2022-09-05 12:47:27 -07:00
Kartik K. Agaram
528c64d690
support drawings in the source editor
2022-09-05 11:29:39 -07:00
Kartik K. Agaram
9fe2af3e34
stray edit from source_text.lua
2022-09-03 15:44:23 -07:00
Kartik K. Agaram
e1c5a42f31
editing source code from within the app
...
integrated from pong.love via text.love:
https://merveilles.town/@akkartik/108933336531898243
2022-09-03 14:13:22 -07:00
Kartik K. Agaram
42762ce062
editing source code from within the app
...
integrated from pong.love: https://merveilles.town/@akkartik/108933336531898243
2022-09-03 13:58:30 -07:00
Kartik K. Agaram
39b2c849c4
Merge lines.love
2022-08-23 15:50:01 -07:00
Kartik K. Agaram
89222f86a0
set color for each fragment
...
In general it seems like good practice to minimize assumptions about
the current color.
2022-08-23 15:09:14 -07:00
Kartik K. Agaram
43dfa184d6
helper: trimming whitespace from strings
2022-08-23 15:06:18 -07:00
Kartik K. Agaram
8d4346f3a8
Merge lines.love
2022-08-19 16:30:38 -07:00
Kartik K. Agaram
cbd8f678d2
fix a name
2022-08-19 16:27:38 -07:00
Kartik K. Agaram
0c7bc1812d
Merge lines.love
2022-08-18 13:48:33 -07:00
Kartik K. Agaram
dd15f15640
couple of accidental globals
...
Luckily they didn't bite me yet.
2022-08-18 13:37:14 -07:00
Kartik K. Agaram
61b59f4dd6
Merge lines.love
2022-08-18 13:11:41 -07:00
Kartik K. Agaram
72866ec0ad
get rid of some ridiculous code
...
I guess I wrote it before I settled into the idiom of:
* first change cursor
* then scroll if necessary
2022-08-18 13:04:04 -07:00
Kartik K. Agaram
0bf34a9ce0
spurious args
2022-08-18 12:09:50 -07:00
Kartik K. Agaram
edcd3d7a9a
dead code
2022-08-18 12:07:50 -07:00
Kartik K. Agaram
1d3c9f4708
generalize a function
2022-08-18 10:32:03 -07:00
Kartik K. Agaram
a14f1096b6
extract a variable
2022-08-18 09:51:43 -07:00
Kartik K. Agaram
f79dd4824c
simplify
2022-08-18 00:19:07 -07:00
Kartik K. Agaram
2923ef3f49
Merge lines.love
2022-08-17 17:44:19 -07:00
Kartik K. Agaram
1221fde164
move caching behavior inside compute_fragments
2022-08-17 16:15:35 -07:00
Kartik K. Agaram
3a74e4bb6c
remove some unnecessary work
2022-08-17 16:13:46 -07:00
Kartik K. Agaram
03f3034930
Merge lines.love
2022-08-17 09:51:17 -07:00
Kartik K. Agaram
dd899d2096
standardize scroll check in a few places
...
I'm taking some lessons from pensieve.love here. It seem like specific
pixel thresholds don't matter too much for plain lines.love.
I'd probably feel safer if I just used Text.cursor_out_of_screen in
these places, but it means we draw the screen twice for most events[1].
Let's see if we can get by with the current approach.
[1] Or we have to start scheduling things for the next draw, which is
more complex to orchestrate.
2022-08-17 09:40:44 -07:00
Kartik K. Agaram
f029c710b5
simplify cursor-on-screen check
2022-08-17 09:36:17 -07:00
Kartik K. Agaram
f11c3f2a9b
Merge lines.love
2022-08-17 09:17:00 -07:00
Kartik K. Agaram
1d710912cc
swap return values
2022-08-17 09:10:52 -07:00
Kartik K. Agaram
68052e807b
Merge lines.love
2022-08-17 07:48:44 -07:00
Kartik K. Agaram
4f128f39f3
obsolete comment
2022-08-16 13:38:10 -07:00
Kartik K. Agaram
1bd5d74b78
Merge lines.love
...
(I'm going to change the format of these commits to be more useful in
the presence of more than one level of upstream.)
2022-08-15 16:17:15 -07:00
Kartik K. Agaram
eba973369e
move
2022-08-15 16:07:32 -07:00
Kartik K. Agaram
5ac18cef45
Merge upstream
2022-08-15 15:57:10 -07:00
Kartik K. Agaram
333a0318d9
drop some unnecessary calls
2022-08-15 15:48:44 -07:00
Kartik K. Agaram
9e0cd4ad4c
stop confusingly reading a global
...
The way Text.draw is called by edit.draw, we know it'll never be called
for lines above screen_top1.line. Comparing every line on screen with
screen_top1 makes no sense. The intent is really just to compare with
screen_top1 only for the first line, and otherwise to ignore this check.
2022-08-15 15:45:02 -07: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
d14e03d706
bugfix: handle drawings when updating screen top
2022-08-11 19:35:12 -07:00
Kartik K. Agaram
9ac68d710b
rename
2022-08-11 19:34:18 -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
8cfffdef41
unnecessary args
2022-08-10 22:29:39 -07:00
Kartik K. Agaram
0218980add
click to the left of a line
2022-07-29 14:38:45 -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
d61b5dfdeb
use line cache for drawings as well
2022-07-20 16:34:09 -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
88013000fc
.
2022-07-20 07:50:33 -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
7dc47edde8
drop an unnecessary level of indent
2022-07-20 07:03:33 -07:00
Kartik K. Agaram
39f71784c9
clean up some prints
...
(Looking at prints in Text.draw, Text.compute_fragments and
Text.nearest_pos_less_than)
2022-07-20 07:00:39 -07:00
Kartik K. Agaram
b5451e4351
move a var closer to its use
2022-07-20 06:56:19 -07:00
Kartik K. Agaram
d41301c1b7
more clearly skip prints before screen top
2022-07-20 06:54:03 -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
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
64eed74980
keep all text cache writes inside text.lua
2022-07-17 10:06:39 -07:00
Kartik K. Agaram
4ff6de9951
switch to line index in a function
...
- Text.screen_line_width
2022-07-17 09:37:50 -07:00
Kartik K. Agaram
7e7f5b9256
switch to line index in a function
...
- Text.compute_fragments
2022-07-17 09:30:50 -07:00
Kartik K. Agaram
860cd49f67
make a function oblivious to line data structure
...
- Text.screen_line_index
2022-07-17 09:21:57 -07:00
Kartik K. Agaram
2859063d9d
switch to line index in a function
...
- Text.to_pos_on_line
2022-07-17 09:19:53 -07:00
Kartik K. Agaram
6b3ddc816f
switch to line index in a function
...
- Text.populate_screen_line_starting_pos
2022-07-17 09:14:10 -07:00
Kartik K. Agaram
48b7de4fde
switch to line index in a function
...
- Text.in_line
2022-07-17 09:14:10 -07:00
Kartik K. Agaram
b95206fd0d
drop some redundant args when clearing the cache
2022-07-17 08:18:48 -07:00
Kartik K. Agaram
038f06a342
drop some redundant args from Text.draw
2022-07-17 08:00:56 -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
70a15b3bc9
replace globals with args in a few functions
...
- Drawing.draw_shape
- Drawing.draw_pending_shape
- Drawing.in_drawing
- Drawing.find_or_insert_point
- Drawing.near
- Drawing.pixels
2022-07-12 21:58:46 -07:00
Kartik K. Agaram
2ae9cacd97
deduce left/right from state where possible
2022-07-12 20:59:24 -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
f7d4deef0c
add state arg to a few functions
...
- Text.cursor_at_final_screen_line
- Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary
- Text.snap_cursor_to_bottom_of_screen
- Text.in_line
- Text.to_pos_on_line
- Text.to2
- Text.to1
- Text.previous_screen_line
- Text.tweak_screen_top_and_cursor
- Text.redraw_all
2022-07-12 17:24:01 -07:00
Kartik K. Agaram
2b1889353b
add state arg to a few functions
...
- Text.pos_at_start_of_cursor_screen_line
- Text.cursor_past_screen_bottom
2022-07-12 17:14:14 -07:00
Kartik K. Agaram
5107df3cd0
add state arg to a few functions
...
- Text.left
- Text.right
- Text.right_without_scroll
2022-07-12 17:10:11 -07:00
Kartik K. Agaram
5b91af1a66
add state arg to a few functions
...
- record_undo_event
- undo_event
- redo_event
- snapshot
2022-07-12 16:55:32 -07:00
Kartik K. Agaram
188bbc73cc
add state arg to a few functions
...
- Text.draw_highlight
- Text.clip_selection
- Text.selection
- Text.cut_selection
- Text.delete_selection
- Text.delete_selection_without_undo
- Text.mouse_pos
- Text.to_pos
2022-07-12 16:51:18 -07:00
Kartik K. Agaram
800a5c064a
add state arg to a few functions
...
- Text.insert_at_cursor
- Text.insert_return
- Text.pageup
- Text.pagedown
- Text.up
- Text.down
- Text.start_of_line
- Text.end_of_line
- Text.word_left
- Text.word_right
2022-07-12 16:39:42 -07:00
Kartik K. Agaram
adeb5416c6
add state arg to Text.textinput
2022-07-12 16:33:26 -07:00
Kartik K. Agaram
b7000215d8
add state arg to schedule_save
2022-07-12 16:30:41 -07:00
Kartik K. Agaram
93aca28cb3
add state arg to Text.keychord_pressed
2022-07-12 16:23:28 -07:00
Kartik K. Agaram
3874f325f8
add state arg to some functions
...
- Text.draw
- Text.draw_cursor
- Text.draw_search_bar
2022-07-12 16:20:20 -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
3850fbac35
make colors easier to edit
2022-07-11 23:18:26 -07:00