From 224e8fe85a55671139527b1e77c88a1f0d629313 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 9 Feb 2023 23:08:06 -0800 Subject: [PATCH] bugfix scenario: press ctrl+f, type in a string hit down arrow if needed until the screen scrolls press enter click with the mouse somewhere Before this commit the app would crash because cursor was above screen top. --- edit.lua | 1 + source_edit.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/edit.lua b/edit.lua index dd9b09b..8f629a4 100644 --- a/edit.lua +++ b/edit.lua @@ -310,6 +310,7 @@ function edit.keychord_press(State, chord, key) Text.delete_selection(State, State.left, State.right) end if State.search_term then + for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll if chord == 'escape' then State.search_term = nil State.search_text = nil diff --git a/source_edit.lua b/source_edit.lua index 85bb463..e17f2f2 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -318,6 +318,7 @@ function edit.keychord_press(State, chord, key) Text.delete_selection(State, State.left, State.right) end if State.search_term then + for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll if chord == 'escape' then State.search_term = nil State.search_text = nil