open file with relative path when possible (#487)

This commit is contained in:
YIQUN
2021-07-07 02:46:10 +08:00
committed by GitHub
parent fd7f60e242
commit db9e70fde5
2 changed files with 8 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ local keypress_funcs = {
close = function() M.close() end,
preview = function(node)
if node.entries ~= nil or node.name == '..' then return end
return lib.open_file('preview', node.absolute_path)
return lib.open_file('preview', node.relative_path)
end,
}
@@ -102,11 +102,11 @@ function M.on_keypress(mode)
end
if node.link_to and not node.entries then
lib.open_file(mode, node.link_to)
lib.open_file(mode, node.relative_path)
elseif node.entries ~= nil then
lib.unroll_dir(node)
else
lib.open_file(mode, node.absolute_path)
lib.open_file(mode, node.relative_path)
end
end