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-11 20:14:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-11 22:23:16 -0700
commite85a7e73d0f4992b775d1848f7343e5da6b225bd (patch)
tree24d825c2a18b4e471dd3d219f8c3f26300eb2609 /search.lua
parent0afd03e72128f691d702ec67f317e6fbf407724e (diff)
downloadlines.love-e85a7e73d0f4992b775d1848f7343e5da6b225bd.tar.gz
bugfix: search upwards
Diffstat (limited to 'search.lua')
-rw-r--r--search.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/search.lua b/search.lua
index 95a7f32..72ee30c 100644
--- a/search.lua
+++ b/search.lua
@@ -79,7 +79,7 @@ end
 
 function Text.search_previous(State)
   -- search current line
-  local pos = rfind(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos)
+  local pos = rfind(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos-1)
   if pos then
     State.cursor1.pos = pos
   end