From 3e6fae63799ba95e6629e845ea5ea97867b347f0 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 10 Apr 2025 18:45:39 +0200 Subject: [PATCH] [Neotree] Fix file watcher --- nvim/lua/plugins/nav/neotree.lua | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/nvim/lua/plugins/nav/neotree.lua b/nvim/lua/plugins/nav/neotree.lua index 0150582..f2b4078 100755 --- a/nvim/lua/plugins/nav/neotree.lua +++ b/nvim/lua/plugins/nav/neotree.lua @@ -9,25 +9,6 @@ return { lazy = false, -- neo-tree will lazily load itself config = function() -- Automatically open up - local function toggle_single_item_folders() - local nodes = require("neo-tree.sources.filesystem").get_nodes() - - for _, node in ipairs(nodes) do - -- Check if the node is a directory - if node.type == "directory" then - local children = node:get_children() - if #children == 1 then - -- If it only has one child, make the folder appear stacked - node.collapsed = false -- Open the directory automatically - else - node.collapsed = true -- Keep multi-item directories collapsed - end - end - end - - -- Refresh Neotree to reflect changes - require("neo-tree").refresh() - end require("neo-tree").setup({ close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab popup_border_style = "rounded", @@ -231,7 +212,7 @@ return { -- "open_current", -- netrw disabled, opening a directory opens within the -- window like netrw would, regardless of window.position -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes + use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes -- instead of relying on nvim autocmd events. window = { mappings = {