about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-12 23:17:02 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-12 23:17:02 -0800
commit92eccaea5ac39f4c362d216b8a74edf6aac3af4a (patch)
tree67d81876469237886668fb7399ff5244e11547ef /edit.lua
parent35f81e5139d48d089fde4599d9ecc53d7cf182f6 (diff)
downloadtext.love-92eccaea5ac39f4c362d216b8a74edf6aac3af4a.tar.gz
bugfix in changing shape mid-stroke
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua
index a7d3027..0a30c77 100644
--- a/edit.lua
+++ b/edit.lua
@@ -289,8 +289,11 @@ function edit.textinput(State, t)
     p.name = p.name..t
     record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
   else
-    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end  -- just in case we scroll
-    Text.textinput(State, t)
+    local drawing_index, drawing = Drawing.current_drawing(State)
+    if drawing_index == nil then
+      for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end  -- just in case we scroll
+      Text.textinput(State, t)
+    end
   end
   schedule_save(State)
 end