Skip to content

fix(files): fixes #71, toggle the correct flags. #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/neo-tree/sources/filesystem/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions lua/neo-tree/sources/filesystem/lib/fs_scan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down