From c064f0a97df56c28d9d76a226ce152d97e40450a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 8 Jul 2024 14:10:49 -0700 Subject: delete some seemingly redundant code We're patching line_cache and then immediately clearing it using Text.redraw_all. --- undo.lua | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'undo.lua') diff --git a/undo.lua b/undo.lua index 8f21a9c..d91fecd 100644 --- a/undo.lua +++ b/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 -- cgit 1.4.1-2-gfad0