I've adjusted mouse_wheel_move to work even when there's no editable pane. It could be improved though. This app really wants some sense of acceleration.
I've also had to hack in a check for cursor_x/cursor_y being nil when scrolling in an editable pane.
JOSUB6GIULB27TORKZW7APTW5W6NQ3AYMN3BM5SSDFB7KT5P2MQQC UCFOE6KJM4USAO3SATXQQQBF3H6ERZCEWIKTYYYSLJK5TASKZOVAC GFXWHTE6POBIOBUMRAWD5QS22JEO52EF4VTLMB4CDK4RLSCK7HCAC KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC LNUHQOGHIOFGJXNGA3DZLYEASLYYDGLN2I3EDZY5ANASQAHCG3YQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC TT6LGCRBUZA4LC26FNDCBKUWAZUEOW4CZ45LEOZPIZFL2NNYYGJAC YQFI33IHRSWTQMOOPYC2NWBFE7G3SXSCRVNRIYVXG3SQO7UFI5PQC KTU3P32MXZW2FOGAWCAT75OCETKNARCIBI2DAYEHYGHACQTII5LQC BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC return edit.mouse_wheel_move(Editor_state, x,y)
if Cursor_pane.col >= 1 thenlocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if pane thenif pane.editable thenif pane.cursor_x thenedit.mouse_wheel_move(pane, dx,dy)plan_draw()returnendendendend-- shift+scroll wheel doesn't set dx for me; manually do so if necessaryif App.shift_down() thenif dx == 0 thendx,dy = dy,dxendendif dy > 0 thenfor i=1,math.floor(dy) dopan_up()endplan_draw()elseif dy < 0 thenfor i=1,math.floor(-dy) dopan_down()endplan_draw()endif dx > 0 thenfor i=1,math.floor(dx) dopan_left()endplan_draw()elseif dx < 0 thenfor i=1,math.floor(-dx) dopan_right()endplan_draw()end
Display_settings.y = math.max(Display_settings.y - Pan_step, 0)local up_sy = up_edge_sy(Cursor_pane.col, Cursor_pane.row)local up_py = up_sy - Display_settings.yif up_py > 2/3*App.screen.height thenCursor_pane.row = math.min(#Surface[Cursor_pane.col], row(Cursor_pane.col, Display_settings.y + App.screen.height/3))end
pan_up()
local visible_column_max_y = most(column_height, visible_columns())if visible_column_max_y - Display_settings.y > App.screen.height/2 thenDisplay_settings.y = Display_settings.y + Pan_stependlocal down_sx = down_edge_sx(Cursor_pane.col, Cursor_pane.row)local down_px = down_sx - Display_settings.yif down_px < App.screen.height/3 thenCursor_pane.row = math.min(#Surface[Cursor_pane.col], row(Cursor_pane.col, Display_settings.y + App.screen.height/3))end
pan_down()
Display_settings.x = math.max(Display_settings.x - Pan_step, 0)local left_sx = left_edge_sx(Cursor_pane.col)local left_px = left_sx - Display_settings.xif left_px > App.screen.width - Margin_right - Display_settings.column_width/2 thenCursor_pane.col = math.min(#Surface, col(Display_settings.x + App.screen.width - Margin_right - Display_settings.column_width/2))Cursor_pane.row = math.min(#Surface[Cursor_pane.col], Cursor_pane.row)end
pan_left()
if Display_settings.x < (#Surface-1) * (Padding_horizontal + Margin_left + Display_settings.column_width + Margin_right) thenDisplay_settings.x = Display_settings.x + Pan_stependlocal right_sx = left_edge_sx(Cursor_pane.col) + Display_settings.column_widthlocal right_px = right_sx - Display_settings.xif right_px < Margin_left + Display_settings.column_width/2 thenCursor_pane.col = math.min(#Surface, col(Display_settings.x + Margin_left + Display_settings.column_width/2))Cursor_pane.row = math.min(#Surface[Cursor_pane.col], Cursor_pane.row)end
pan_right()
endfunction pan_up()Display_settings.y = math.max(Display_settings.y - Pan_step, 0)local up_sy = up_edge_sy(Cursor_pane.col, Cursor_pane.row)local up_py = up_sy - Display_settings.yif up_py > 2/3*App.screen.height thenCursor_pane.row = math.min(#Surface[Cursor_pane.col], row(Cursor_pane.col, Display_settings.y + App.screen.height/3))endendfunction pan_down()local visible_column_max_y = most(column_height, visible_columns())if visible_column_max_y - Display_settings.y > App.screen.height/2 thenDisplay_settings.y = Display_settings.y + Pan_stependlocal down_sx = down_edge_sx(Cursor_pane.col, Cursor_pane.row)local down_px = down_sx - Display_settings.yif down_px < App.screen.height/3 thenCursor_pane.row = math.min(#Surface[Cursor_pane.col], row(Cursor_pane.col, Display_settings.y + App.screen.height/3))endendfunction pan_left()Display_settings.x = math.max(Display_settings.x - Pan_step, 0)local left_sx = left_edge_sx(Cursor_pane.col)local left_px = left_sx - Display_settings.xif left_px > App.screen.width - Margin_right - Display_settings.column_width/2 thenCursor_pane.col = math.min(#Surface, col(Display_settings.x + App.screen.width - Margin_right - Display_settings.column_width/2))Cursor_pane.row = math.min(#Surface[Cursor_pane.col], Cursor_pane.row)end
function pan_right()if Display_settings.x < (#Surface-1) * (Padding_horizontal + Margin_left + Display_settings.column_width + Margin_right) thenDisplay_settings.x = Display_settings.x + Pan_stependlocal right_sx = left_edge_sx(Cursor_pane.col) + Display_settings.column_widthlocal right_px = right_sx - Display_settings.xif right_px < Margin_left + Display_settings.column_width/2 thenCursor_pane.col = math.min(#Surface, col(Display_settings.x + Margin_left + Display_settings.column_width/2))Cursor_pane.row = math.min(#Surface[Cursor_pane.col], Cursor_pane.row)endend
endendfunction edit.mouse_wheel_move(State, dx,dy)if dy > 0 thenState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}for i=1,math.floor(dy) doText.up(State)endelseState.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}for i=1,math.floor(-dy) doText.down(State)end