about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-08 15:30:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-08 15:30:10 -0700
commita27dd15c1f0e69d2259bcc9a7c246edcd7200f67 (patch)
tree7321d0ef4ff343cf24a019a65c877103fc03d234 /text.lua
parent0853a030ac72454f9aad775872b7c269d3969513 (diff)
downloadtext.love-a27dd15c1f0e69d2259bcc9a7c246edcd7200f67.tar.gz
add args to some functions
  - Text.clip_selection
  - Text.cut_selection
  - Text.delete_selection
  - Text.delete_selection_without_undo
  - Text.mouse_pos
  - Text.to_pos
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/text.lua b/text.lua
index 873bf00..d66adde 100644
--- a/text.lua
+++ b/text.lua
@@ -49,7 +49,7 @@ function Text.draw(line, line_index, top, left, right)
     -- don't draw text above screen top
     if Text.le1(Screen_top1, {line=line_index, pos=pos}) then
       if Selection1.line then
-        local lo, hi = Text.clip_selection(line_index, pos, pos+frag_len)
+        local lo, hi = Text.clip_selection(line_index, pos, pos+frag_len, left, right)
         Text.draw_highlight(line, x,y, pos, lo,hi)
       end
 --?       print('drawing '..frag)
@@ -184,7 +184,7 @@ function Text.keychord_pressed(chord)
     record_undo_event({before=before, after=snapshot(Cursor1.line)})
   elseif chord == 'backspace' then
     if Selection1.line then
-      Text.delete_selection()
+      Text.delete_selection(Margin_left, App.screen.width-Margin_right)
       schedule_save()
       return
     end
@@ -225,7 +225,7 @@ function Text.keychord_pressed(chord)
     record_undo_event({before=before, after=snapshot(Cursor1.line)})
   elseif chord == 'delete' then
     if Selection1.line then
-      Text.delete_selection()
+      Text.delete_selection(Margin_left, App.screen.width-Margin_right)
       schedule_save()
       return
     end