about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-12 23:50:36 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-12 23:50:36 -0800
commit97fa2b0a7a397d94337fb6d514e0d2e0eb8022af (patch)
treef2c6ac3d269fd205171ec39f52eb7766431d8632
parente1f99e7fad9ab6d07c478edce2ba740a83f676cc (diff)
parent1d27d595337ee663ab29a970ea1b6013bbdbbb97 (diff)
downloadview.love-97fa2b0a7a397d94337fb6d514e0d2e0eb8022af.tar.gz
Merge lines.love
-rw-r--r--source_edit.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/source_edit.lua b/source_edit.lua
index 242aca5..8c1b37d 100644
--- a/source_edit.lua
+++ b/source_edit.lua
@@ -299,8 +299,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