about summary refs log tree commit diff stats
path: root/search.lua
diff options
context:
space:
mode:
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 2b4ea99..4aa1f02 100644
--- a/search.lua
+++ b/search.lua
@@ -17,7 +17,7 @@ function Text.draw_search_bar(State)
 end
 
 function Text.search_next(State)
-  assert(#State.search_term > 0)
+  if #State.search_term == 0 then return end
   -- search current line from cursor
   local curr_pos = State.cursor1.pos
   local curr_line = State.lines[State.cursor1.line].data
@@ -72,7 +72,7 @@ function Text.search_next(State)
 end
 
 function Text.search_previous(State)
-  assert(#State.search_term > 0)
+  if #State.search_term == 0 then return end
   -- search current line before cursor
   local curr_pos = State.cursor1.pos
   local curr_line = State.lines[State.cursor1.line].data