diff --git a/lua/neo-tree/sources/filesystem/commands.lua b/lua/neo-tree/sources/filesystem/commands.lua index efdfa146..bd22ef26 100644 --- a/lua/neo-tree/sources/filesystem/commands.lua +++ b/lua/neo-tree/sources/filesystem/commands.lua @@ -95,13 +95,13 @@ end ---Toggles whether hidden files are shown or not. M.toggle_hidden = function(state) - state.show_hidden = not state.show_hidden + state.filters.show_hidden = not state.filters.show_hidden fs.show() end ---Toggles whether the tree is filtered by gitignore or not. M.toggle_gitignore = function(state) - state.respect_gitignore = not state.respect_gitignore + state.filters.respect_gitignore = not state.filters.respect_gitignore fs.show() end diff --git a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua index fc63f3d7..f7ab45d9 100644 --- a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua +++ b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua @@ -16,10 +16,11 @@ local function do_scan(context, path_to_scan) local state = context.state local paths_to_load = context.paths_to_load local folders = context.folders + local filters = state.filters scan.scan_dir_async(path_to_scan, { - hidden = state.show_hidden or false, - respect_gitignore = state.respect_gitignore or false, + hidden = filters.show_hidden or false, + respect_gitignore = filters.respect_gitignore or false, search_pattern = state.search_pattern or nil, add_dirs = true, depth = 1,