about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-12 22:31:45 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-12 22:31:45 -0800
commit8b30e0608beb111a0273d653f724b6b6c6979d43 (patch)
treeaf09f192cedbb1e9c9ff056f5e1314aa71f56dfe
parent076611fbb5ddb1756a2dcb4a04f54b823c3ef68d (diff)
downloadview.love-8b30e0608beb111a0273d653f724b6b6c6979d43.tar.gz
bugfix: naming points in drawings
We had a regression since commit 60e1023f0 on Nov 27. Turns out we do
need the ancient hack after all.

But no, we won't go back to the hack. It's a simple problem to fix
right. And while we're at it, we'll fix the test harness to be more
realistic so it would have caught this problem.
-rw-r--r--edit.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/edit.lua b/edit.lua
index e0a5ff1..a7d3027 100644
--- a/edit.lua
+++ b/edit.lua
@@ -278,7 +278,6 @@ function edit.mouse_released(State, x,y, mouse_button)
 end
 
 function edit.textinput(State, t)
-  for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end  -- just in case we scroll
   if State.search_term then
     State.search_term = State.search_term..t
     State.search_text = nil
@@ -290,6 +289,7 @@ 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)
   end
   schedule_save(State)
@@ -490,6 +490,7 @@ function edit.run_after_textinput(State, t)
   edit.textinput(State, t)
   edit.key_released(State, t)
   App.screen.contents = {}
+  edit.update(State, 0)
   edit.draw(State)
 end
 
@@ -498,6 +499,7 @@ function edit.run_after_keychord(State, chord)
   edit.keychord_pressed(State, chord)
   edit.key_released(State, chord)
   App.screen.contents = {}
+  edit.update(State, 0)
   edit.draw(State)
 end
 
@@ -507,6 +509,7 @@ function edit.run_after_mouse_click(State, x,y, mouse_button)
   App.fake_mouse_release(x,y, mouse_button)
   edit.mouse_released(State, x,y, mouse_button)
   App.screen.contents = {}
+  edit.update(State, 0)
   edit.draw(State)
 end
 
@@ -514,6 +517,7 @@ function edit.run_after_mouse_press(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
   edit.mouse_pressed(State, x,y, mouse_button)
   App.screen.contents = {}
+  edit.update(State, 0)
   edit.draw(State)
 end
 
@@ -521,5 +525,6 @@ function edit.run_after_mouse_release(State, x,y, mouse_button)
   App.fake_mouse_release(x,y, mouse_button)
   edit.mouse_released(State, x,y, mouse_button)
   App.screen.contents = {}
+  edit.update(State, 0)
   edit.draw(State)
 end