Skip to content

Commit 3540c31

Browse files
authored
fix(files): fixes #71, toggle the correct flags. (#75)
Toggle the state.filters.(show_hidden|respect_gitignore) flags, instead of setting them on the root state object.
1 parent 8a2d3e8 commit 3540c31

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lua/neo-tree/sources/filesystem/commands.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ end
9595

9696
---Toggles whether hidden files are shown or not.
9797
M.toggle_hidden = function(state)
98-
state.show_hidden = not state.show_hidden
98+
state.filters.show_hidden = not state.filters.show_hidden
9999
fs.show()
100100
end
101101

102102
---Toggles whether the tree is filtered by gitignore or not.
103103
M.toggle_gitignore = function(state)
104-
state.respect_gitignore = not state.respect_gitignore
104+
state.filters.respect_gitignore = not state.filters.respect_gitignore
105105
fs.show()
106106
end
107107

lua/neo-tree/sources/filesystem/lib/fs_scan.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ local function do_scan(context, path_to_scan)
1616
local state = context.state
1717
local paths_to_load = context.paths_to_load
1818
local folders = context.folders
19+
local filters = state.filters
1920

2021
scan.scan_dir_async(path_to_scan, {
21-
hidden = state.show_hidden or false,
22-
respect_gitignore = state.respect_gitignore or false,
22+
hidden = filters.show_hidden or false,
23+
respect_gitignore = filters.respect_gitignore or false,
2324
search_pattern = state.search_pattern or nil,
2425
add_dirs = true,
2526
depth = 1,

0 commit comments

Comments
 (0)