diff --git a/edit.lua b/edit.lua index 3f87551..b894dde 100644 --- a/edit.lua +++ b/edit.lua @@ -310,7 +310,7 @@ function edit.mouse_wheel_move(State, dx,dy) for i=1,math.floor(dy) do Text.up(State) end - else + 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) diff --git a/log_browser.lua b/log_browser.lua index cd0d8fc..46d84c0 100644 --- a/log_browser.lua +++ b/log_browser.lua @@ -268,7 +268,7 @@ function log_browser.mouse_wheel_move(State, dx,dy) for i=1,math.floor(dy) do log_browser.up(State) end - else + elseif dy < 0 then for i=1,math.floor(-dy) do log_browser.down(State) end diff --git a/run.lua b/run.lua index ae78d9b..17477ea 100644 --- a/run.lua +++ b/run.lua @@ -163,9 +163,9 @@ function run.mouse_release(x,y, mouse_button) return edit.mouse_release(Editor_state, x,y, mouse_button) end -function run.mouse_wheel_move(x,y) +function run.mouse_wheel_move(dx,dy) Cursor_time = 0 -- ensure cursor is visible immediately after it moves - return edit.mouse_wheel_move(Editor_state, x,y) + return edit.mouse_wheel_move(Editor_state, dx,dy) end function run.text_input(t) diff --git a/source_edit.lua b/source_edit.lua index 60ed027..b70aab1 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -311,7 +311,7 @@ function edit.mouse_wheel_move(State, dx,dy) for i=1,math.floor(dy) do Text.up(State) end - else + 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)