Skip to content

Commit 29a72ef

Browse files
fix: apply suggestions from code review
Co-authored-by: Alexander Courtis <alex@courtis.org>
1 parent 8e518e3 commit 29a72ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lua/nvim-tree/explorer/filters.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
local utils = require "nvim-tree.utils"
22
local marks = require "nvim-tree.marks"
33

4+
---@class Filters to handle all opts.filters and related API
5+
---@field config table hydrated user opts.filters
6+
---@field private explorer Explorer
7+
---@field private exclude_list string[] filters.exclude
8+
---@field private ignore_list string[] filters.custom string table
9+
---@field private custom_function (fun(absolute_path: string): boolean)|nil filters.custom function
410
local Filters = {}
511

12+
---@param opts table user options
13+
---@param explorer Explorer
14+
---@return Filters
615
function Filters:new(opts, explorer)
716
local o = {
817
explorer = explorer,
@@ -144,7 +153,7 @@ local function custom(self, path)
144153
local basename = utils.path_basename(path)
145154

146155
-- filter user's custom function
147-
if self.custom_function and self:custom_function(path) then
156+
if self.custom_function and self.custom_function(path) then
148157
return true
149158
end
150159

0 commit comments

Comments
 (0)