You can either drag the scrollbar or click anywhere in the scrollbar area.
It has this weird funkiness that the scrollbar shrinks as you get near the bottom. But it feels.. weirdly satisfying?
IP4LD33DQFWQ4654YPNJRKQ3CNYSHRZPX6U6ZPY7OLE744XX3MEQC
UEG224LHBOPWSKOVXTKVAUEL47HET566LJF7ZSWVKMMLBSJWUHFAC
MZ3DMYPD4LSSQKEA3GNI5MK2QNTJ523DTNG6DUPWEWLH4FLUIQSAC
25V2GA6JNWMYNBNFLBHFPJ5ZFYQ4E25E4XMTJSTQJGPPK56RSBAAC
FS2ITYYHBLFT66YUC3ENPFYI2HOYHOVEPQIN7NQR6KF5MEK4NKZAC
WKKABOJ6WDJ37ELFMS4R3OAJOSPZNZANBVWRMKBCALJKAGSPNUTAC
VYAFKS7RAF4Q2D4BUCMXZGILUMQ74KH57MXVRKX4X2J4WILZSQEAC
3G723RV5YPWQQQ52OMKDQAQ2OXV6NGLFXLPNB7YXH5WZIYC7PQXQC
D4FEFHQCSILZFQ5VLWNXAIRZNUMCDNGJSM4UJ6T6FDMMIWYRYILQC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
ZM7NOBRMD5HHA35Y4JDC76EOA2RD4KQOQCPURXYKXA6ABMKOJIGQC
5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC
on_editor_scrollbar_area = function(x,y)
if x < Editor_state.right+20 then return end
if x > Editor_state.right+40 then return end
if y < Editor_state.top then return end
if y > Editor_state.bottom then return end
return true
end
on_editor_scrollbar = function(x,y)
if x < Editor_state.right+20 then return end
if x > Editor_state.right+40 then return end
if y < Editor_scrollbar_top then return end
if y > Editor_scrollbar_bottom then return end
return true
end
Editor_scrollbar_top = 0 -- in px
Editor_scrollbar_bottom = 0
adjust_scrollbar = function(y)
local s = (y-Editor_state.top) / (Editor_state.bottom-Editor_state.top)
local screen_line = s*Editor_state.screen_line_count
local line = 1
for i=1,#Editor_state.lines do
if Editor_state.line_cache[i].start_screen_line_index > screen_line then
break
end
line = i
end
Editor_state.screen_top1 = {line=line, pos=1}
Editor_state.cursor1 = {line=line, pos=1}
end
edit.mouse_release(Editor_state, x,y, mouse_button)
if Editor_scrollbar_drag then
adjust_scrollbar(y)
Editor_scrollbar_drag = nil
elseif on_editor_scrollbar_area(x,y) then
adjust_scrollbar(y)
else
edit.mouse_release(Editor_state, x,y, mouse_button)
end
edit.mouse_press(Editor_state, x,y, mouse_button)
if on_editor_scrollbar(x,y) then
Editor_scrollbar_drag = true
elseif on_editor_scrollbar_area(x,y) then
-- nothing
else
edit.mouse_press(Editor_state, x,y, mouse_button)
end