Commit Graph

25 Commits

Author SHA1 Message Date
Kartik K. Agaram 95d88a8298 use editor state font for width calculations 2024-01-12 05:23:06 -08:00
Kartik K. Agaram 007b965b11 audit all asserts
Each one should provide a message that will show up within LÖVE. Stop
relying on nearby prints to the terminal.

I also found some unnecessary ones.

There is some potential here for performance regressions: the format()
calls will trigger whether or not the assertion fails, and cause
allocations. So far Lua's GC seems good enough to manage the load even
with Moby Dick, even in some situations that caused issues in the past
like undo.
2023-11-18 11:32:01 -08:00
Kartik K. Agaram ea4a8379fe rfind bugfix: handle empty pattern like string.find 2023-10-15 14:21:41 -07:00
Kartik K. Agaram 6b723363b8 add some tests for rfind 2023-10-15 14:20:55 -07:00
Kartik K. Agaram 8e02c2c021 bugfix: searching files containing unicode
Before this change the cursor was moving, but not being highlighted
properly when the cursor line contained unicode before the cursor.
2023-05-13 17:02:10 -07:00
Kartik K. Agaram 876d6298b4 App.width can no longer take a Text
In the process I discovered the horrible fact that Text.x allocates a new Text.
And it gets called (just once, thank goodness) on every single frame.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram 22bf3da7de reduce use of rfind 2023-01-13 09:10:48 -08:00
Kartik K. Agaram 0a6dec2fb4 support special chars like '(' in search 2022-09-18 23:50:16 -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 1d3c9f4708 generalize a function 2022-08-18 10:32:03 -07:00
Kartik K. Agaram cf8d9774ea drop some obsolete args 2022-08-18 10:29:50 -07:00
Kartik K. Agaram 1d710912cc swap return values 2022-08-17 09:10:52 -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 8b880f4fe8 search: transparently handle drawings everywhere 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 e26470aada update cursor in search box 2022-07-25 18:17:04 -07:00
Kartik K. Agaram 3265abacb4 bugfix: skip over drawings when searching 2022-07-25 09:49:26 -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 5aae527759 add state arg to a few functions
- Text.search_next
  - Text.search_previous
2022-07-12 17:02:53 -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
Kartik K. Agaram 0106ad4b4f add args to some functions
- Text.pos_at_start_of_cursor_screen_line
2022-07-08 15:49:52 -07:00
Kartik K. Agaram 0d52962b3e extract a couple of files 2022-06-03 14:17:41 -07:00