This time we have to handle absolute filenames. Now lines-polygon-experiment fork should merge successfully, at least.
A23MMLJHXQOVDZHJCPCCP4SIFXTB7HXJMCCDAM2I7Q7BAIXMAYBAC
end
function dirname(path)
local os_path_separator = package.config:sub(1,1)
if os_path_separator == '/' then
-- POSIX systems permit backslashes in filenames
return path:match('.*/') or './'
elseif os_path_separator == '\\' then
return path:match('.*[/\\]') or './'
else
error('What OS is this? LÖVE reports that the path separator is "'..os_path_separator..'"')
end
end
function test_dirname()
check_eq(dirname('a/b'), 'a/', 'F - test_dirname')
check_eq(dirname('x'), './', 'F - test_dirname/current')
end
function basename(path)
local os_path_separator = package.config:sub(1,1)
if os_path_separator == '/' then
-- POSIX systems permit backslashes in filenames
return string.gsub(path, ".*/(.*)", "%1")
elseif os_path_separator == '\\' then
return string.gsub(path, ".*[/\\](.*)", "%1")
else
error('What OS is this? LÖVE reports that the path separator is "'..os_path_separator..'"')
end
function empty(h)
for _,_ in pairs(h) do
return false
end
return true
end
Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1
Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1
if File_navigation.cursors[Editor_state.filename] then
Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1
Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1
else
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.cursor1 = {line=1, pos=1}
end