From dfb3f0458a5be28d99d63542d04af7d484cbb7da Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 7 Sep 2024 04:26:21 +0200 Subject: [PATCH] fix(neotree): text and action --- lua/codemp/neo-tree/commands.lua | 3 ++- lua/codemp/neo-tree/components.lua | 5 ++++- lua/codemp/neo-tree/init.lua | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/codemp/neo-tree/commands.lua b/lua/codemp/neo-tree/commands.lua index d742658..05d77b4 100644 --- a/lua/codemp/neo-tree/commands.lua +++ b/lua/codemp/neo-tree/commands.lua @@ -14,7 +14,8 @@ M.open = function(state, path, extra) local selected = state.tree:get_node() if selected.type == "spacer" then return end if selected.type == "title" then return end - if selected.type == "root" then + if selected.type == "root" then selected:toggle() end + if selected.type == "button" then if selected.name == "[connect]" and session.client == nil then client_manager.connect() end diff --git a/lua/codemp/neo-tree/components.lua b/lua/codemp/neo-tree/components.lua index fee2cc0..01f30d1 100644 --- a/lua/codemp/neo-tree/components.lua +++ b/lua/codemp/neo-tree/components.lua @@ -48,7 +48,10 @@ M.icon = function(config, node, state) highlight = codemp_utils.color(node.name) elseif node.type == "entry" then icon = "$" - highlight = highlight.GIT_STAGED + highlight = highlights.GIT_STAGED + elseif node.type == "button" then + icon = " " + highlight = highlights.NORMAL end return { diff --git a/lua/codemp/neo-tree/init.lua b/lua/codemp/neo-tree/init.lua index 41f0b45..cb19958 100644 --- a/lua/codemp/neo-tree/init.lua +++ b/lua/codemp/neo-tree/init.lua @@ -49,6 +49,7 @@ M.default_config = { }, button = { { "indent" }, + { "icon" }, { "name" }, }, },