feat: Closes #205
This commit is contained in:
@@ -84,6 +84,8 @@ function config.set_defaults(defaults)
|
||||
|
||||
set("generic_sorter", sorters.get_generic_fuzzy_sorter)
|
||||
set("file_sorter", sorters.get_fuzzy_file)
|
||||
|
||||
set("file_ignore_patterns", nil)
|
||||
end
|
||||
|
||||
function config.clear_defaults()
|
||||
|
||||
@@ -81,6 +81,7 @@ function Picker:new(opts)
|
||||
stats = {},
|
||||
|
||||
attach_mappings = opts.attach_mappings,
|
||||
file_ignore_patterns = get_default(opts.file_ignore_patterns, config.values.file_ignore_patterns),
|
||||
|
||||
sorting_strategy = get_default(opts.sorting_strategy, config.values.sorting_strategy),
|
||||
selection_strategy = get_default(opts.selection_strategy, config.values.selection_strategy),
|
||||
@@ -421,6 +422,13 @@ function Picker:find()
|
||||
|
||||
log.trace("Processing result... ", entry)
|
||||
|
||||
for _, v in ipairs(self.file_ignore_patterns or {}) do
|
||||
if string.find(entry.value, v) then
|
||||
log.debug("SKPIPING", entry.value, "because", v)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local sort_ok, sort_score = nil, 0
|
||||
if self.sorter then
|
||||
sort_ok, sort_score = self:_track("_sort_time", pcall, self.sorter.score, self.sorter, prompt, entry)
|
||||
|
||||
Reference in New Issue
Block a user