about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-02-09 23:08:06 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-02-09 23:09:23 -0800
commit224e8fe85a55671139527b1e77c88a1f0d629313 (patch)
tree50c9e74b87f2747bb01bdacb4b8f83263a2b06a6 /edit.lua
parentf4e14ad484c89033150f69f6820e337b49c2b298 (diff)
downloadtext.love-224e8fe85a55671139527b1e77c88a1f0d629313.tar.gz
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.
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua1
1 files changed, 1 insertions, 0 deletions
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