about summary refs log tree commit diff stats
path: root/source_undo.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-07-08 14:10:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-07-08 14:10:49 -0700
commitc064f0a97df56c28d9d76a226ce152d97e40450a (patch)
tree998977f1b0f0be0581519275de2e8ef16ce775dc /source_undo.lua
parent5a74b6938e5a37b8b2d1f8e49039cf1cbae46a50 (diff)
downloadlines.love-c064f0a97df56c28d9d76a226ce152d97e40450a.tar.gz
delete some seemingly redundant code
We're patching line_cache and then immediately clearing it using
Text.redraw_all.
Diffstat (limited to 'source_undo.lua')
-rw-r--r--source_undo.lua11
1 files changed, 0 insertions, 11 deletions
diff --git a/source_undo.lua b/source_undo.lua
index 8f21a9c..d91fecd 100644
--- a/source_undo.lua
+++ b/source_undo.lua
@@ -81,17 +81,6 @@ function patch(lines, from, to)
   end
 end
 
-function patch_placeholders(line_cache, from, to)
-  assert(from.start_line == to.start_line, 'failed to patch undo operation')
-  for i=from.end_line,from.start_line,-1 do
-    table.remove(line_cache, i)
-  end
-  assert(#to.lines == to.end_line-to.start_line+1, 'failed to patch undo operation')
-  for i=1,#to.lines do
-    table.insert(line_cache, to.start_line+i-1, {})
-  end
-end
-
 -- https://stackoverflow.com/questions/640642/how-do-you-copy-a-lua-table-by-value/26367080#26367080
 function deepcopy(obj, seen)
   if type(obj) ~= 'table' then return obj end