about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--edit.lua2
-rw-r--r--source_edit.lua2
2 files changed, 4 insertions, 0 deletions
diff --git a/edit.lua b/edit.lua
index 1ac2bd1..d30dbdc 100644
--- a/edit.lua
+++ b/edit.lua
@@ -343,11 +343,13 @@ 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}
+    edit.put_cursor_on_next_text_line(State)
     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}
+    edit.put_cursor_on_next_text_line(State)
     for i=1,math.floor(-dy) do
       Text.down(State)
     end
diff --git a/source_edit.lua b/source_edit.lua
index f949aa5..6dbf883 100644
--- a/source_edit.lua
+++ b/source_edit.lua
@@ -333,11 +333,13 @@ 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}
+    edit.put_cursor_on_next_text_line(State)
     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}
+    edit.put_cursor_on_next_text_line(State)
     for i=1,math.floor(-dy) do
       Text.down(State)
     end