From 8a984260e75f85869fcf897575f3950380410f92 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 5 Jan 2013 01:48:13 +0000 Subject: [PATCH] manually apply #220 to fix NERDTreeFind for hidden dirs --- autoload/nerdtree.vim | 2 +- plugin/nerdtree/path.vim | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/autoload/nerdtree.vim b/autoload/nerdtree.vim index 9f4beb3..fdc816d 100644 --- a/autoload/nerdtree.vim +++ b/autoload/nerdtree.vim @@ -179,7 +179,7 @@ function! nerdtree#findAndRevealPath() return endtry - if p.isUnixHiddenFile() + if p.isUnixHiddenPath() let showhidden=g:NERDTreeShowHidden let g:NERDTreeShowHidden = 1 endif diff --git a/plugin/nerdtree/path.vim b/plugin/nerdtree/path.vim index 9ef0b28..8c01339 100644 --- a/plugin/nerdtree/path.vim +++ b/plugin/nerdtree/path.vim @@ -327,6 +327,21 @@ function! s:Path.isUnixHiddenFile() return self.getLastPathComponent(0) =~# '^\.' endfunction +"FUNCTION: Path.isUnixHiddenPath() {{{3 +"check for unix path with hidden components +function! s:Path.isUnixHiddenPath() + if self.getLastPathComponent(0) =~# '^\.' + return 1 + else + for segment in self.pathSegments + if segment =~# '^\.' + return 1 + endif + endfor + return 0 + endif +endfunction + "FUNCTION: Path.ignore() {{{3 "returns true if this path should be ignored function! s:Path.ignore() @@ -693,3 +708,4 @@ function! s:Path.WinToUnixPath(pathstr) return toReturn endfunction +" vim: set sw=4 sts=4 et fdm=marker: