From 6a0ba3968555e561d45d09d0cb11d753364e73d1 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 7 Sep 2024 05:10:58 +0200 Subject: [PATCH] fix(neotree): expand also children --- lua/codemp/neo-tree/bridge.lua | 3 +++ lua/codemp/neo-tree/commands.lua | 1 + 2 files changed, 4 insertions(+) diff --git a/lua/codemp/neo-tree/bridge.lua b/lua/codemp/neo-tree/bridge.lua index dc1ed8f..0fefa6e 100644 --- a/lua/codemp/neo-tree/bridge.lua +++ b/lua/codemp/neo-tree/bridge.lua @@ -160,6 +160,9 @@ M.update_state = function(state) renderer.show_nodes(root, state) for _, node in ipairs(state.tree:get_nodes()) do node:expand() + for _, child_node in ipairs(state.tree:get_nodes(node)) do + child_node:expand() + end end end diff --git a/lua/codemp/neo-tree/commands.lua b/lua/codemp/neo-tree/commands.lua index f088d0d..3279bd6 100644 --- a/lua/codemp/neo-tree/commands.lua +++ b/lua/codemp/neo-tree/commands.lua @@ -14,6 +14,7 @@ local function toggle(node) else node:expand() end + manager.refresh("codemp") end M.refresh = require("neo-tree.utils").wrap(manager.refresh, "codemp")