about summary refs log tree commit diff stats
path: root/source_edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-10-29 16:04:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-10-29 16:04:14 -0700
commit1693f1f160e0567cf0bf1f26d3d61f577082cdfb (patch)
tree5fadc16bed61ceccbbda889840f1b43cefb20f07 /source_edit.lua
parentc1a3616964bfdeb11144c0e7289fc16ba563e84a (diff)
downloadlines.love-1693f1f160e0567cf0bf1f26d3d61f577082cdfb.tar.gz
bugfix #2 in search UI
Diffstat (limited to 'source_edit.lua')
-rw-r--r--source_edit.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/source_edit.lua b/source_edit.lua
index 90c1171..733ca61 100644
--- a/source_edit.lua
+++ b/source_edit.lua
@@ -432,10 +432,14 @@ function edit.keychord_press(State, chord, key)
       State.screen_top = deepcopy(State.search_backup.screen_top)
       Text.search_next(State)
     elseif chord == 'down' then
-      edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
-      Text.search_next(State)
+      if #State.search_term > 0 then
+        edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)
+        Text.search_next(State)
+      end
     elseif chord == 'up' then
-      Text.search_previous(State)
+      if #State.search_term > 0 then
+        Text.search_previous(State)
+      end
     end
     return
   elseif chord == 'C-f' then