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
parent b3f01721f0
commit 97492e9c8a
No known key found for this signature in database
GPG Key ID: 133589DC38921AE2

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