about summary refs log tree commit diff stats
path: root/undo.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-08-15 10:31:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-15 11:00:35 -0700
commita655c2113cdc80095402243ce41e1322dea535ab (patch)
tree87fcd7af0242e1791c732c14f47556653cc02f87 /undo.lua
parent778f77a4585c538211f79e717bae35fd650eee90 (diff)
downloadview.love-a655c2113cdc80095402243ce41e1322dea535ab.tar.gz
bring back a level of wrapping
Many projects will require the ability to add metadata to lines, so
let's not drop that.
Diffstat (limited to 'undo.lua')
-rw-r--r--undo.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/undo.lua b/undo.lua
index 9e55fe8..912c949 100644
--- a/undo.lua
+++ b/undo.lua
@@ -57,7 +57,8 @@ function snapshot(State, s,e)
   }
   -- deep copy lines without cached stuff like text fragments
   for i=s,e do
-    table.insert(event.lines, State.lines[i])
+    local line = State.lines[i]
+    table.insert(event.lines, {data=line.data})
   end
   return event
 end