about summary refs log tree commit diff stats
path: root/select.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-26 16:34:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-26 16:34:06 -0700
commit44fb3ecd55a7b0cd45b604d5431811e0852a4714 (patch)
tree31bcf4d5c4d78638de820ac5d32515c1c4af33b8 /select.lua
parent22330664098826620ab783f2d6f68e3639660f9e (diff)
downloadlines.love-44fb3ecd55a7b0cd45b604d5431811e0852a4714.tar.gz
bugfix: deleting a selection spanning pages
Diffstat (limited to 'select.lua')
-rw-r--r--select.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/select.lua b/select.lua
index 219fe3e..59f79d0 100644
--- a/select.lua
+++ b/select.lua
@@ -133,6 +133,10 @@ function Text.delete_selection_without_undo()
   -- update Cursor1 and Selection1
   Cursor1.line = minl
   Cursor1.pos = minp
+  if Text.lt1(Cursor1, Screen_top1) then
+    Screen_top1.line = Cursor1.line
+    _,Screen_top1.pos = Text.pos_at_start_of_cursor_screen_line()
+  end
   Selection1 = {}
   -- delete everything between min (inclusive) and max (exclusive)
   Text.clear_cache(Lines[minl])