about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-10-29 17:47:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-10-29 17:47:38 -0700
commit6975b8b7210296da1280a56c29f279eac39cdbda (patch)
tree735ff990ac247634fb0d64fdb965258624bd4cdd /edit.lua
parent0940e7276100c4a368d12e03522aea45bb42b8ed (diff)
downloadview.love-6975b8b7210296da1280a56c29f279eac39cdbda.tar.gz
bugfix #3, attempt #2 in search UI
Avoid accidental side-effects.
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua
index 9e80cc3..44e58ab 100644
--- a/edit.lua
+++ b/edit.lua
@@ -426,8 +426,10 @@ 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)
     end