refactor(#2828): multi instance nvim-tree.explorer.filters (#2841)

* refactor(#2828): multi instance nvim-tree.explorer.filters

* fix: style

* fix: apply suggestions from code review

Co-authored-by: Alexander Courtis <alex@courtis.org>

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Mateusz Russak
2024-07-27 05:29:27 +02:00
committed by GitHub
parent 1aa9852cad
commit 908478a0e0
8 changed files with 142 additions and 94 deletions

View File

@@ -1,7 +1,6 @@
local view = require "nvim-tree.view"
local utils = require "nvim-tree.utils"
local Iterator = require "nvim-tree.iterators.node-iterator"
local filters = require "nvim-tree.explorer.filters"
local M = {
filter = nil,
@@ -57,7 +56,8 @@ end
---@param node Node
---@return boolean
local function matches(node)
if not filters.config.enable then
local explorer = require("nvim-tree.core").get_explorer()
if not explorer or not explorer.filters.config.enable then
return true
end