about summary refs log tree commit diff stats
path: root/select.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-17 21:05:01 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-17 21:05:01 -0700
commit29dac6a6eccf5e5f09debe789fb4f314e460088b (patch)
treee9c7d252374c0c3b1ad6130a07875280d1f6d47e /select.lua
parent64eed749809a4412a6663d149cd57a41431df91d (diff)
downloadlines.love-29dac6a6eccf5e5f09debe789fb4f314e460088b.tar.gz
separate data structure for each line's cache data
I have no idea what the performance implications of this are..
Diffstat (limited to 'select.lua')
-rw-r--r--select.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/select.lua b/select.lua
index a728f84..ec48e3f 100644
--- a/select.lua
+++ b/select.lua
@@ -149,6 +149,7 @@ function Text.delete_selection_without_undo(State)
   local rhs = State.lines[maxl].data:sub(max_offset)
   for i=maxl,minl+1,-1 do
     table.remove(State.lines, i)
+    table.remove(State.text_line_cache, i)
   end
   State.lines[minl].data = State.lines[minl].data:sub(1, min_offset-1)..rhs
 end