NEKADRAL5JYGCVY7PYWC73SVQQUFCAYE6AHXIFHNMLUYV5XUQOOAC
YU7LZFIFZ7U2XC5U37AK3I5SULKCTRLZ4P357WWM6IWETGHTXS7QC
W6XUYQKPHYZLEMBPY5L2WCGXIDBKAHVAWAH5V7BKYQXZO33DTNIQC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
ZTK4QTZTZLI6E7MAJFKXH26MIICJSZWSM7SYSZP7U7C2IAZPGGFQC
RQUVBX627HPVMS77HCERQGTGFNP6JXSBBAZNR2PTNT6B7LRRGQIAC
3QWK3GSA5KTVQJKXQ65OGZA2AORHFALLBXWP2A4MN6YDE7VV4PUAC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
MSOQI3A5BC5PY2MZXZQAQ4EQDT4KICQJPN3YUZVDYTWXSPZWBLIAC
3Q6IFM4UFTJYM2D5BK4A54D3N2OMZC33XYPEOB2NEJZ6PDN2WRCAC
LXTTOB33N2HCUZFIUDRQGGBVHK2HODRG4NBLH6RXRQZDCHF27BSAC
5ZA3BRNYWKSGEBJ4JLA4UBC3LJPT5JBWYCU7PQYRSGX6MJMEWDIQC
AMOPICKVRHMQERJLFPMAAEBV7TL5QACGGSBJWRCMV5R5O3KDVETAC
navigate_to_file(File_navigation.candidates[File_navigation.index])
elseif chord == 'backspace' then
local len = utf8.len(File_navigation.filter)
local byte_offset = Text.offset(File_navigation.filter, len)
File_navigation.filter = string.sub(File_navigation.filter, 1, byte_offset-1)
File_navigation.index = 1
File_navigation.candidates = source.file_navigator_candidates()
reset_file_navigator()
elseif chord == 'return' then
function navigate_to_file(s)
local candidate = guess_source(s..'.lua')
source.switch_to_file(candidate)
reset_file_navigator()
end
function reset_file_navigator()
Show_file_navigator = false
File_navigation.index = 1
File_navigation.filter = ''
File_navigation.candidates = File_navigation.all_candidates
end
function keychord_pressed_on_file_navigator(chord, key)
end
function move_candidate_to_front(s)
local index = array.find(File_navigation.all_candidates, s)
assert(index)
table.remove(File_navigation.all_candidates, index)
table.insert(File_navigation.all_candidates, 1, s)
move_candidate_to_front(s)
navigate_to_file(s)
end
})
function navigate_to_file(s)
move_candidate_to_front(s)
local candidate = guess_source(s..'.lua')
source.switch_to_file(candidate)
reset_file_navigator()
end
function move_candidate_to_front(s)
local index = array.find(File_navigation.all_candidates, s)
assert(index)
table.remove(File_navigation.all_candidates, index)
table.insert(File_navigation.all_candidates, 1, s)
end
function reset_file_navigator()
Show_file_navigator = false
File_navigation.index = 1
File_navigation.filter = ''
File_navigation.candidates = File_navigation.all_candidates
end
local candidate = guess_source(File_navigation.candidates[File_navigation.index]..'.lua')
source.switch_to_file(candidate)
Show_file_navigator = false
File_navigation.index = 1
File_navigation.filter = ''
File_navigation.candidates = File_navigation.all_candidates
navigate_to_file(File_navigation.candidates[File_navigation.index])