mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
feat(explorer): navigate with h/l to close/open directories. Closes #833
This commit is contained in:
parent
f936021dfe
commit
4b29ddc5d9
2 changed files with 8 additions and 0 deletions
|
@ -61,6 +61,8 @@ M.explorer = {
|
|||
list = {
|
||||
keys = {
|
||||
["<BS>"] = "explorer_up",
|
||||
["l"] = "confirm",
|
||||
["h"] = "explorer_close", -- close directory
|
||||
["a"] = "explorer_add",
|
||||
["d"] = "explorer_del",
|
||||
["r"] = "explorer_rename",
|
||||
|
|
|
@ -294,6 +294,12 @@ M.actions = {
|
|||
explorer_up = function(picker)
|
||||
M.get_state(picker):up()
|
||||
end,
|
||||
explorer_close = function(picker)
|
||||
local state = M.get_state(picker)
|
||||
local dir = state:dir()
|
||||
state.expanded[dir] = false
|
||||
state:update()
|
||||
end,
|
||||
explorer_add = function(picker)
|
||||
local state = M.get_state(picker)
|
||||
Snacks.input({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue