@@ 405,8 405,10 @@ function I.on_keychord_pressed(editor, chord, key)
editor.screen_top = I.deepcopy(editor.search_backup.screen_top)
I.search_next(editor)
elseif chord == 'down' then
- I.on_right_arrow(editor)
- I.search_next(editor)
+ if #editor.search_term > 0 then
+ I.on_right_arrow(editor)
+ I.search_next(editor)
+ end
elseif chord == 'up' then
I.search_previous(editor)
end
@@ 1478,6 1480,7 @@ function I.draw_search_bar(editor)
end
function I.search_next(editor)
+ if #editor.search_term == 0 then return end
local offset
-- search current line from cursor
local curr_pos = editor.cursor.pos
@@ 1528,6 1531,7 @@ function I.search_next(editor)
end
function I.search_previous(editor)
+ if #editor.search_term == 0 then return end
local offset
-- search current line before cursor
local curr_pos = editor.cursor.pos