Skip to content

Commit f4b5a5b

Browse files
committed
fix(files): keep focused node when navigating up
1 parent 6238235 commit f4b5a5b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/neo-tree/sources/filesystem/commands.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ end
5353
---Navigate up one level.
5454
M.navigate_up = function(state)
5555
local parent_path, _ = utils.split_path(state.path)
56+
local path_to_reveal = nil
57+
local node = state.tree:get_node()
58+
if node then
59+
path_to_reveal = node:get_id()
60+
end
5661
if state.search_pattern then
5762
fs.reset_search(false)
5863
end
59-
fs.navigate(parent_path)
64+
fs.navigate(parent_path, path_to_reveal)
6065
end
6166

6267
M.open = function(state)

0 commit comments

Comments
 (0)