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-23 17:16:19 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-23 18:52:28 -0800
commit2b3e09ca0fadcaaeac8d563aae1baeb7e7da3754 (patch)
treefa1d6ef4e18c53c9d4400917ade89e063a30a8c3 /edit.lua
parente2e3aea2b1b9504bf849d1ab3ca9eb16544b651d (diff)
downloadtext.love-2b3e09ca0fadcaaeac8d563aae1baeb7e7da3754.tar.gz
make love event names consistent
I want the words to be easy to read, and to use a consistent tense.
update and focus seem more timeless; let's make everything like those.
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua38
1 files changed, 19 insertions, 19 deletions
diff --git a/edit.lua b/edit.lua
index 4945529..ed5a79f 100644
--- a/edit.lua
+++ b/edit.lua
@@ -214,7 +214,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
         --    sets cursor
         --  press and hold to start a selection: sets selection on press, cursor on release
         --  press and hold, then press shift: ignore shift
-        --    i.e. mouse_released should never look at shift state
+        --    i.e. mouse_release should never look at shift state
         State.old_cursor1 = State.cursor1
         State.old_selection1 = State.selection1
         State.mousepress_shift = App.shift_down()
@@ -238,11 +238,11 @@ function edit.mouse_pressed(State, x,y, mouse_button)
   end
 end
 
-function edit.mouse_released(State, x,y, mouse_button)
+function edit.mouse_release(State, x,y, mouse_button)
   if State.search_term then return end
 --?   print('release')
   if State.lines.current_drawing then
-    Drawing.mouse_released(State, x,y, mouse_button)
+    Drawing.mouse_release(State, x,y, mouse_button)
     schedule_save(State)
     if Drawing.before then
       record_undo_event(State, {before=Drawing.before, after=snapshot(State, State.lines.current_drawing_index)})
@@ -277,7 +277,7 @@ function edit.mouse_released(State, x,y, mouse_button)
   end
 end
 
-function edit.textinput(State, t)
+function edit.text_input(State, t)
   if State.search_term then
     State.search_term = State.search_term..t
     State.search_text = nil
@@ -292,13 +292,13 @@ function edit.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)
+      Text.text_input(State, t)
     end
   end
   schedule_save(State)
 end
 
-function edit.keychord_pressed(State, chord, key)
+function edit.keychord_press(State, chord, key)
   if State.selection1.line and
       not State.lines.current_drawing and
       -- printable character created using shift key => delete selection
@@ -422,7 +422,7 @@ function edit.keychord_pressed(State, chord, key)
     local drawing_index, drawing = Drawing.current_drawing(State)
     if drawing_index then
       local before = snapshot(State, drawing_index)
-      Drawing.keychord_pressed(State, chord)
+      Drawing.keychord_press(State, chord)
       record_undo_event(State, {before=before, after=snapshot(State, drawing_index)})
       schedule_save(State)
     end
@@ -454,11 +454,11 @@ function edit.keychord_pressed(State, chord, key)
     schedule_save(State)
   else
     for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end  -- just in case we scroll
-    Text.keychord_pressed(State, chord)
+    Text.keychord_press(State, chord)
   end
 end
 
-function edit.key_released(State, key, scancode)
+function edit.key_release(State, key, scancode)
 end
 
 function edit.update_font_settings(State, font_height)
@@ -486,21 +486,21 @@ function edit.initialize_test_state()
       15)  -- line height
 end
 
--- all textinput events are also keypresses
+-- all text_input events are also keypresses
 -- TODO: handle chords of multiple keys
-function edit.run_after_textinput(State, t)
-  edit.keychord_pressed(State, t)
-  edit.textinput(State, t)
-  edit.key_released(State, t)
+function edit.run_after_text_input(State, t)
+  edit.keychord_press(State, t)
+  edit.text_input(State, t)
+  edit.key_release(State, t)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)
 end
 
--- not all keys are textinput
+-- not all keys are text_input
 function edit.run_after_keychord(State, chord)
-  edit.keychord_pressed(State, chord)
-  edit.key_released(State, chord)
+  edit.keychord_press(State, chord)
+  edit.key_release(State, chord)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)
@@ -510,7 +510,7 @@ function edit.run_after_mouse_click(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
   edit.mouse_pressed(State, x,y, mouse_button)
   App.fake_mouse_release(x,y, mouse_button)
-  edit.mouse_released(State, x,y, mouse_button)
+  edit.mouse_release(State, x,y, mouse_button)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)
@@ -526,7 +526,7 @@ end
 
 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)
+  edit.mouse_release(State, x,y, mouse_button)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)