about summary refs log tree commit diff stats
path: root/search.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-08-18 10:22:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-18 10:32:03 -0700
commit1d3c9f47085ee5d9cfa37d988d53f2dfead0195a (patch)
tree2b95e57cdd9ea18ec748fea7dc9458723fcec3b1 /search.lua
parentcf8d9774eac577b4cd4fdb77cbb27b6b46004756 (diff)
downloadlines.love-1d3c9f47085ee5d9cfa37d988d53f2dfead0195a.tar.gz
generalize a function
Diffstat (limited to 'search.lua')
-rw-r--r--search.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/search.lua b/search.lua
index 01a832b..bd28d58 100644
--- a/search.lua
+++ b/search.lua
@@ -62,7 +62,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)
+    local pos = Text.pos_at_start_of_screen_line(State, State.cursor1)
     State.screen_top1.pos = pos
   end
 end
@@ -110,7 +110,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)
+    local pos = Text.pos_at_start_of_screen_line(State, State.cursor1)
     State.screen_top1.pos = pos
   end
 end