diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-17 09:19:53 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-17 09:19:53 -0700 |
commit | 2859063d9d10f05a3db695cf3ccd142a7432a43f (patch) | |
tree | 3c8c2f33d72965909d2cce1a258dbbde0f929bd8 /edit.lua | |
parent | 6b3ddc816ff6784ed36d6254d35c8d12ada28246 (diff) | |
download | text.love-2859063d9d10f05a3db695cf3ccd142a7432a43f.tar.gz |
switch to line index in a function
- Text.to_pos_on_line
Diffstat (limited to 'edit.lua')
-rw-r--r-- | edit.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua index 2de3cb2..17bbc9e 100644 --- a/edit.lua +++ b/edit.lua @@ -215,7 +215,7 @@ function edit.mouse_pressed(State, x,y, mouse_button) State.mousepress_shift = App.shift_down() State.selection1 = { line=line_index, - pos=Text.to_pos_on_line(State, line, x, y), + pos=Text.to_pos_on_line(State, line_index, x, y), } --? print('selection', State.selection1.line, State.selection1.pos) break @@ -249,7 +249,7 @@ function edit.mouse_released(State, x,y, mouse_button) --? print('reset selection') State.cursor1 = { line=line_index, - pos=Text.to_pos_on_line(State, line, x, y), + pos=Text.to_pos_on_line(State, line_index, x, y), } --? print('cursor', State.cursor1.line, State.cursor1.pos) if State.mousepress_shift then |