mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 04:13:48 -05:00
add a path filter API
Add an API to allow custom "path filter callbacks" to be added. Previously we allowed one path filtering function to exist called `NERDTreeCustomIgnoreFilter`. This has been removed and replaced with an API to allow any number of such functions to exist - via the new `NERDTreeAddPathFilter()`
This commit is contained in:
@@ -392,6 +392,12 @@ function! s:Path.ignore()
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
for callback in g:NERDTree.PathFilters()
|
||||
if {callback}({'path': self, 'nerdtree': b:NERDTree})
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
"dont show hidden files unless instructed to
|
||||
@@ -403,10 +409,6 @@ function! s:Path.ignore()
|
||||
return 1
|
||||
endif
|
||||
|
||||
if exists("*NERDTreeCustomIgnoreFilter") && NERDTreeCustomIgnoreFilter(self)
|
||||
return 1
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user