diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-03-23 21:43:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-03-23 21:43:26 -0700 |
commit | aa8994167f06680beba998a08e8f4d782537d540 (patch) | |
tree | b809984f58eb96e27c5a075ac17a7b33fcb074b8 /source_edit.lua | |
parent | 75dfd3fd623ea0755b1c5a5056af0e569dcfecc5 (diff) | |
parent | a6dcfc5ac862637719b35c0fda137fdb4015c540 (diff) | |
download | text.love-aa8994167f06680beba998a08e8f4d782537d540.tar.gz |
Merge lines.love
Diffstat (limited to 'source_edit.lua')
-rw-r--r-- | source_edit.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source_edit.lua b/source_edit.lua index 964f6ff..b70aab1 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -305,6 +305,20 @@ function edit.mouse_release(State, x,y, mouse_button) end end +function edit.mouse_wheel_move(State, dx,dy) + if dy > 0 then + State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos} + for i=1,math.floor(dy) do + Text.up(State) + end + elseif dy < 0 then + State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos} + for i=1,math.floor(-dy) do + Text.down(State) + end + end +end + function edit.text_input(State, t) if State.search_term then State.search_term = State.search_term..t |