On dir_up, keep the current node selected and visible

This commit is contained in:
Joel D. Elkins
2021-01-13 13:17:01 -06:00
committed by Kiyan
parent 0a4123b71f
commit 52a2905135

View File

@@ -371,11 +371,9 @@ function M.dir_up(node)
if not node then
return M.change_dir('..')
else
local newdir = vim.fn.fnamemodify(node.absolute_path, ':h')
if newdir == M.Tree.cwd then
M.change_dir('..')
end
return M.set_index_and_redraw(newdir)
local newdir = vim.fn.fnamemodify(M.Tree.cwd, ':h')
M.change_dir(newdir)
return M.set_index_and_redraw(node.absolute_path)
end
end