about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-10-29 18:47:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-10-29 18:47:51 -0700
commitac8981e7580e8ad02c1f8445fc00ab08ba75b648 (patch)
treedb39afd33ac97bf82ed2898f3bcd7c92c642fb63
parent6f122e9865dba44f4f05821373c60b4adc5b74df (diff)
parent883ad16cd253d25963edc020ea1c1d827de74b79 (diff)
downloadview.love-ac8981e7580e8ad02c1f8445fc00ab08ba75b648.tar.gz
Merge text.love
-rw-r--r--edit.lua8
-rw-r--r--text.lua4
2 files changed, 6 insertions, 6 deletions
diff --git a/edit.lua b/edit.lua
index 9d98694..8e91a03 100644
--- a/edit.lua
+++ b/edit.lua
@@ -92,7 +92,7 @@ function edit.invalid_cursor1(State)
   return cursor1.pos > #State.lines[cursor1.line].data + 1
 end
 
-function edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)
+function edit.put_cursor_on_next_line_wrapping_around_if_necessary(State)
   local line = State.cursor1.line
   local max = #State.lines
   for _ = 1, max-1 do
@@ -110,7 +110,7 @@ function edit.put_cursor_on_next_loc_wrapping_around_if_necessary(State)
   if State.cursor1.pos <= utf8.len(cursor_line) then
     State.cursor1.pos = State.cursor1.pos + 1
   else
-    edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)
+    edit.put_cursor_on_next_line_wrapping_around_if_necessary(State)
   end
 end
 
@@ -188,7 +188,7 @@ function edit.mouse_press(State, x,y, mouse_button)
   State.old_cursor1 = State.cursor1
   State.old_selection1 = State.selection1
   State.mousepress_shift = App.shift_down()
-  State.selection1 = Text.final_text_loc_on_screen(State)
+  State.selection1 = Text.final_loc_on_screen(State)
 end
 
 function edit.mouse_release(State, x,y, mouse_button)
@@ -214,7 +214,7 @@ function edit.mouse_release(State, x,y, mouse_button)
   end
 
   -- still here? mouse release is below all screen lines
-  State.cursor1 = Text.final_text_loc_on_screen(State)
+  State.cursor1 = Text.final_loc_on_screen(State)
   edit.clean_up_mouse_press(State)
 --?   print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
 end
diff --git a/text.lua b/text.lua
index 8f6bf95..7f962cf 100644
--- a/text.lua
+++ b/text.lua
@@ -493,7 +493,7 @@ function Text.pos_at_end_of_screen_line(State, loc1)
   assert(false, ('invalid pos %d'):format(loc1.pos))
 end
 
-function Text.final_text_loc_on_screen(State)
+function Text.final_loc_on_screen(State)
   local screen_bottom1 = Text.screen_bottom1(State)
   return {
     line=screen_bottom1.line,
@@ -809,7 +809,7 @@ function Text.tweak_screen_top_and_cursor(State)
     State.cursor1 = deepcopy(State.screen_top1)
   elseif State.cursor1.line >= screen_bottom1.line then
     if Text.cursor_out_of_screen(State) then
-      State.cursor1 = Text.final_text_loc_on_screen(State)
+      State.cursor1 = Text.final_loc_on_screen(State)
     end
   end
 end