Replies: 1 comment
-
I did something like this: filesystem = {
window = {
mappings = {
["<BS>"] = "navigate_up_and_close",
},
},
commands = {
navigate_up_and_close = function(state)
local fs = require("neo-tree.sources.filesystem")
local utils = require("neo-tree.utils")
local parent_path, _ = utils.split_path(state.path)
if not utils.truthy(parent_path) then
return
end
local path_to_reveal = nil
local node = state.tree:get_node()
if node then
path_to_reveal = node:get_id()
end
if state.search_pattern then
fs.reset_search(state, false)
end
fs._navigate_internal(state, parent_path, path_to_reveal, function()
require("neo-tree.sources.common.commands").close_node(state)
end , false)
end
},
} Basically copy pasted the internal code for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
You can already hit backspace to move the root up a level. I want that, but with all folders closed after. I have a sort-of working version:
Where
neotree_zC
recursively closes folders, and is shown back in #445. Without delaying it viadefer_fn
, it doesn't work, so I assume there's an aync thing going on here. Is there a way to wait fornavigate_up
to complete, or otherwise avoid hacky "just wait a while" solutions?Beta Was this translation helpful? Give feedback.
All reactions