From 0940e7276100c4a368d12e03522aea45bb42b8ed Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 29 Oct 2024 16:27:23 -0700 Subject: bugfix #3 in search UI This is a regression. Scenario: search for a string, then backspace until it goes empty. --- search.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'search.lua') 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 -- cgit 1.4.1-2-gfad0