LXFHXL2NSH7KLRNNN66OPNSU4DXZ6UU2CUPXUHCFEISDB6BY7KDAC
QF3HGULONECPRBR4K4IEA5TQQLCIPQWADAKXNSPFQFBPOEK5A4LQC
VOU73AK6XOVIOCY6PHUXS5RQZ2TGFEF7RYNOKFE2XSHRCZBAJMYQC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC
3G723RV5YPWQQQ52OMKDQAQ2OXV6NGLFXLPNB7YXH5WZIYC7PQXQC
D4B52CQ2QKG2HQKFUQOO5S2ME325DTW3PH2D7SBXCW4BPQFYG7CAC
3PSFWAILGRA4OYXWS2DX7VF332AIBPYBXHEA4GIQY2XEJVD65UMAC
ORKN6EOBUFVAD2TXYW5OIKSL55RU24LOFDTTTXHDZUZ57QRDCY7QC
36Z442IVPXHZ7D2QI26YLN3TDDEMDRQ2GKBYQAD6NUHQZVCCY4VAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
2Y7YH7UPQWDNYDJN4BYY2MOHA36B2BIRX6DMIAKHJPQC7UP2R6NQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
4DHGKUMDTRLJHNRO5UCLE457HF3PHFQC7GMDEIFY6UYTYP45MKZAC
XGHCLIKBWIW24G7O5QLYH6EUIY3TWTYFTUIYTWE25RFEGBHMZOKQC
GFXWHTE6POBIOBUMRAWD5QS22JEO52EF4VTLMB4CDK4RLSCK7HCAC
2CK5QI7WA7M4IVSACFGOJYAIDKRUTZVMMPSFWEJTUNMWTN7AX4NAC
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
function source.mouse_wheel_move(dx,dy)
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
if Focus == 'edit' then
return edit.mouse_wheel_move(Editor_state, dx,dy)
else
return log_browser.mouse_wheel_move(Log_browser_state, dx,dy)
end
end
function source.text_input(t)
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, dx,dy)
end
function run.text_input(t)
function log_browser.down(State)
while State.screen_top1.line < #State.lines do
State.screen_top1.line = State.screen_top1.line+1
if should_show(State.lines[State.screen_top1.line]) then
break
end
end
end
function log_browser.height(State, line_index)
local line = State.lines[line_index]
if line.data == nil then
-- section header
return State.line_height
elseif type(line.data) == 'string' then
return State.line_height
else
if line.height == nil then
--? print('nil line height! rendering off screen to calculate')
line.height = log_render[line.data.name](line.data, State.left, App.screen.height, State.right-State.left)
end
return line.height
end
end
end
end
end
function log_browser.up(State)
while State.screen_top1.line > 1 do
State.screen_top1.line = State.screen_top1.line-1
if should_show(State.lines[State.screen_top1.line]) then
break
end
end
end
log_browser.down(State)
elseif chord == 'pageup' then
local y = 0
while State.screen_top1.line > 1 and y < App.screen.height - 100 do
State.screen_top1.line = State.screen_top1.line - 1
if should_show(State.lines[State.screen_top1.line]) then
y = y + log_browser.height(State, State.screen_top1.line)
end
end
elseif chord == 'pagedown' then
local y = 0
while State.screen_top1.line < #State.lines and y < App.screen.height - 100 do
if should_show(State.lines[State.screen_top1.line]) then
y = y + log_browser.height(State, State.screen_top1.line)
end
State.screen_top1.line = State.screen_top1.line + 1
log_browser.up(State)
elseif chord == 'down' then
end
function log_browser.mouse_wheel_move(State, dx,dy)
if dy > 0 then
for i=1,math.floor(dy) do
log_browser.up(State)
end
elseif dy < 0 then
for i=1,math.floor(-dy) do
log_browser.down(State)
end
end
end
end
function App.wheelmoved(dx,dy)
if run.mouse_wheel_move then run.mouse_wheel_move(dx,dy) end
if source.mouse_wheel_move then source.mouse_wheel_move(dx,dy) end
else
assert(false, 'unknown app "'..Current_app..'"')
end
function App.mousereleased(x,y, mouse_button)
if Current_app == 'run' then
if run.mouse_release then run.mouse_release(x,y, mouse_button) end
elseif Current_app == 'source' then
if source.mouse_release then source.mouse_release(x,y, mouse_button) end