about summary refs log tree commit diff stats
path: root/undo.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-10 11:45:53 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-10 11:45:53 -0700
commit79a12413700dca5816d6c27fc4951bdd7579e329 (patch)
tree0c49c32a68c411320a7f65ce8bf323a9b1679d73 /undo.lua
parentfcacb6e63d1aefd7aedc858e6efa39d8102eb6ba (diff)
downloadtext.love-79a12413700dca5816d6c27fc4951bdd7579e329.tar.gz
undo creating new drawings
Diffstat (limited to 'undo.lua')
-rw-r--r--undo.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/undo.lua b/undo.lua
index 2513632..3007070 100644
--- a/undo.lua
+++ b/undo.lua
@@ -42,6 +42,11 @@ function snapshot(s,e)
   elseif e == nil then
     e = s
   end
+  assert(#Lines > 0)
+  if s < 1 then s = 1 end
+  if s > #Lines then s = #Lines end
+  if e < 1 then e = 1 end
+  if e > #Lines then e = #Lines end
   -- compare with App.initialize_globals
   local event = {
     screen_top=deepcopy(Screen_top1),