feat: add api.tree.toggle_enable_filters (#2706)

* feat: toggle filters

* naming refactoring

* change name to enable

* fix default opt

* fix api name

* update doc

* remove default keybinding, toggle live filter

* add API doc

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Denys Lytviak
2024-03-16 02:35:13 +01:00
committed by GitHub
parent 707b24af91
commit f7c09bd72e
6 changed files with 29 additions and 0 deletions

View File

@@ -150,6 +150,10 @@ end
---@param status table from prepare
---@return boolean
function M.should_filter(path, status)
if not M.config.enable then
return false
end
-- exclusions override all filters
if is_excluded(path) then
return false
@@ -160,6 +164,7 @@ end
function M.setup(opts)
M.config = {
enable = opts.filters.enable,
filter_custom = true,
filter_dotfiles = opts.filters.dotfiles,
filter_git_ignored = opts.filters.git_ignored,