feat(preview): enhanced preview to toggle folder (#907)

Co-authored-by: MusiCool <wenjun.super@bytedance.com>
This commit is contained in:
Wen Jun
2022-01-21 18:29:17 +08:00
committed by GitHub
parent 1248bcec86
commit 2e25ba5958

View File

@@ -95,7 +95,12 @@ local keypress_funcs = {
dir_up = lib.dir_up,
close = function() M.close() end,
preview = function(node)
if node.entries ~= nil or node.name == '..' then return end
if node.entries ~= nil then
if (node.name == '..') then
return
end
return lib.expand_or_collapse(node)
end
return lib.open_file('preview', node.absolute_path)
end,
system_open = require'nvim-tree.actions.system-open'.fn,