@@ -17,12 +17,12 @@ local function do_scan(context, path_to_scan)
1717 local state = context .state
1818 local paths_to_load = context .paths_to_load
1919 local folders = context .folders
20- local filters = state .filters or {}
20+ local filters = state .filtered_items or {}
2121
2222 scan .scan_dir_async (path_to_scan , {
23- hidden = filters .show_hidden or false ,
2423 search_pattern = state .search_pattern or nil ,
25- respect_gitignore = filters .respect_gitignore and filters .gitignore_source == " plenary" ,
24+ hidden = true ,
25+ respect_gitignore = false ,
2626 add_dirs = true ,
2727 depth = 1 ,
2828 on_insert = function (path , _type )
@@ -103,7 +103,7 @@ M.get_items_async = function(state, parent_id, path_to_reveal, callback)
103103 if state .search_pattern then
104104 -- Use the external command because the plenary search is slow
105105 filter_external .find_files ({
106- filters = state .filters ,
106+ filtered_items = state .filtered_items ,
107107 find_command = state .find_command ,
108108 limit = state .search_limit or 50 ,
109109 path = root .path ,
@@ -148,11 +148,12 @@ M.get_items_async = function(state, parent_id, path_to_reveal, callback)
148148 context .paths_to_load = utils .unique (context .paths_to_load )
149149 end
150150
151+ local f = state .filtered_items or {}
151152 local ignored = {}
152- if state . filters . respect_gitignore then
153- if state . filters .gitignore_source == " git status" then
153+ if f . hide_gitignored then
154+ if f .gitignore_source == " git status" then
154155 ignored = git .load_ignored (state .path )
155- elseif state . filters .gitignore_source == " git check-ignore" then
156+ elseif f .gitignore_source == " git check-ignore" then
156157 ignored = git .load_ignored_per_directory (state .path )
157158 for _ , p in ipairs (context .paths_to_load ) do
158159 vim .list_extend (ignored , git .load_ignored_per_directory (p ))
@@ -162,9 +163,8 @@ M.get_items_async = function(state, parent_id, path_to_reveal, callback)
162163 state .git_ignored = ignored
163164 else
164165 -- just update the ignored list for this dir if we are using the per dir 'check-ignore' option
165- if
166- state .filters .respect_gitignore and state .filters .gitignore_source == " git check-ignore"
167- then
166+ local f = state .filtered_items or {}
167+ if f .hide_gitignored and f .gitignore_source == " git check-ignore" then
168168 state .git_ignored = state .git_ignored or {}
169169 vim .list_extend (state .git_ignored , git .load_ignored_per_directory (parent_id ))
170170 end
0 commit comments