feat: filters.custom can specify regex (#1112)
This commit is contained in:
parent
4d8ab7d158
commit
00fd8aefe0
@ -405,7 +405,8 @@ Here is a list of the options available in the setup call:
|
|||||||
type: `boolean`
|
type: `boolean`
|
||||||
default: `false`
|
default: `false`
|
||||||
|
|
||||||
- |filters.custom|: custom list of string that will not be shown.
|
- |filters.custom|: custom list of vim regex for file/directory names that will not be shown.
|
||||||
|
Backslashes must be escaped e.g. "^\\.git". See |string-match|.
|
||||||
type: `{string}`
|
type: `{string}`
|
||||||
default: `{}`
|
default: `{}`
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,10 @@ function M.should_ignore(path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local relpath = utils.path_relative(path, vim.loop.cwd())
|
local relpath = utils.path_relative(path, vim.loop.cwd())
|
||||||
if M.ignore_list[relpath] == true or M.ignore_list[basename] == true then
|
for pat, _ in pairs(M.ignore_list) do
|
||||||
return true
|
if vim.fn.match(relpath, pat) ~= -1 or vim.fn.match(basename, pat) ~= -1 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local idx = path:match ".+()%.[^.]+$"
|
local idx = path:match ".+()%.[^.]+$"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user