From 37292668f40abee9095dda2e0a9f2a34fd58bad2 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sat, 31 May 2025 12:49:22 +0800 Subject: [PATCH] feat nvim: neo-tree add winbar --- .../exact_plugins/exact_components/neo-tree.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_components/neo-tree.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_components/neo-tree.lua index c7c66fb..ff41735 100644 --- a/dot_config/nvim/exact_lua/exact_plugins/exact_components/neo-tree.lua +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_components/neo-tree.lua @@ -475,8 +475,8 @@ return { -- 自行加入的 source_selector = { - winbar = false, - statusline = false + winbar = true, + statusline = true } }, config = function(_, opts) @@ -502,6 +502,17 @@ return { require("neo-tree").setup(opts) + -- 打Patch:暫時解決winbar與nui.nvim 不完全兼容錯誤 + -- [Neo-tree ERROR] debounce neo-tree-follow error: ~/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:261: Invalid 'window': Expected Lua number + local Tree = require("nui.tree") + local old_set_win = Tree.set_win + Tree.set_win = function(self, window) + if type(window) ~= "number" or not vim.api.nvim_win_is_valid(window) then + return + end + return old_set_win(self, window) + end + -- vim.keymap.set("n", "e", "Neotree reveal") -- 自動命令:啟動時自動顯示 Neo-tree