Drawbacks I can see so far:
7MMFX7LON7VH7PPZWAALQMRFVBAQD44Q5RBIJEI4GNEVWN47NO2AC
HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQC
WLHI7KD3LJTQH6V7RLVJWGZUR4YQK6LN4OIUMIN45BGMMQGN6RNQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
4KC7I3E2DIKLIP7LQRKB5WFA2Z5XZXAU46RFHNFQU5BVEJPDX6UQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
end
-- If fragment is a filename relative to the current directory, register
-- a button for clicks on it.
local filename = rtrim(frag) -- compute_fragments puts whitespace at the end
if file_exists(filename) then
local filename_text = App.newText(love.graphics.getFont(), filename)
button(State, 'link', {x=x,y=y, w=App.width(filename_text), h=State.line_height, color={1,1,1},
icon = icon.hyperlink_decoration,
onpress1 = function()
switch_to_file(filename)
end,
})
-- a copy of App.filedropped when given a filename
function switch_to_file(filename)
-- first make sure to save edits on any existing file
if Editor_state.next_save then
save_to_disk(Editor_state)
end
-- clear the slate for the new file
--? print('switching to', filename)
Editor_state.filename = filename
load_from_disk(Editor_state)
Text.redraw_all(Editor_state)
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.cursor1 = {line=1, pos=1}
end
icon = {}
function icon.hyperlink_decoration(button_params)
local x,y = button_params.x, button_params.y
App.color(Hyperlink_decoration_color)
love.graphics.line(x,y+Editor_state.line_height, x+button_params.w,y+Editor_state.line_height)
end