diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 18:29:00 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 20:54:50 -0700 |
commit | 3b36093553920fb2548332e983a32aa6fe218fd2 (patch) | |
tree | 72466962f6c71af141790f9b5cb1eb0abc8c322c /search.lua | |
parent | 1ede1c3c6d3fc2ec8070da4c726b3fbe1bf9d374 (diff) | |
download | lines.love-3b36093553920fb2548332e983a32aa6fe218fd2.tar.gz |
left/right margin -> left/right coordinates
Editor state initialization now depends on window dimensions, so we have to more carefully orchestrate startup.
Diffstat (limited to 'search.lua')
-rw-r--r-- | search.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/search.lua b/search.lua index 499eb2b..2e86688 100644 --- a/search.lua +++ b/search.lua @@ -56,7 +56,7 @@ function Text.search_next(State) end if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) then State.screen_top1.line = State.cursor1.line - local _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.margin_left, App.screen.width-State.margin_right) + local _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.left, State.right) State.screen_top1.pos = pos end end @@ -96,7 +96,7 @@ function Text.search_previous(State) end if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) then State.screen_top1.line = State.cursor1.line - local _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.margin_left, App.screen.width-State.margin_right) + local _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.left, State.right) State.screen_top1.pos = pos end end |