From 5c2060149f52b31786e9003222d3dc54ba80fed9 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Wed, 6 May 2015 21:19:06 +0100 Subject: [PATCH] doc NERDTreeAddPathFilter() --- doc/NERD_tree.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index 85dfba6..6418b57 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -34,6 +34,7 @@ CONTENTS *NERDTree-contents* 4.The NERD tree API.......................|NERDTreeAPI| 4.1.Key map API.......................|NERDTreeKeymapAPI| 4.2.Menu API..........................|NERDTreeMenuAPI| + 4.3.Menu API..........................|NERDTreeAddPathFilter()| 5.About...................................|NERDTreeAbout| 6.Changelog...............................|NERDTreeChangelog| 7.Credits.................................|NERDTreeCredits| @@ -1173,6 +1174,24 @@ Where selecting "a (s)ub menu" will lead to a second menu: > When any of the 3 concrete menu items are selected the function "SomeFunction" will be called. +------------------------------------------------------------------------------ +4.3 NERDTreeAddPathFilter(callback) *NERDTreeAddPathFilter()* + +Path filters are essentially a more powerful version of |NERDTreeIgnore|. +If the simple regex matching in |NERDTreeIgnore| is not enough then use +|NERDTreeAddPathFilter()| to add a callback function that paths will be +checked against when the decision to ignore them is made. Example > + + call NERDTreeAddPathFilter('MyFilter') + + function! MyFilter(params) + "params is a dict containing keys: 'nerdtree' and 'path' which are + "g:NERDTree and g:NERDTreePath objects + + "return 1 to ignore params['path'] or 0 otherwise + endfunction +< + ------------------------------------------------------------------------------ NERDTreeRender() *NERDTreeRender()* Re-renders the NERD tree buffer. Useful if you change the state of the @@ -1203,6 +1222,7 @@ Next - add 'scope' argument to the key map API - add NERDTreeCustomIgnoreFilter hook - needs doc - add magic [[dir]] and [[file]] flags to NERDTreeIgnore + - add support for custom path filters. See :help NERDTreeAddPathFilter() 4.2.0 - Add NERDTreeDirArrows option to make the UI use pretty arrow chars