diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 3e7c1bbc..31248969 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2486,6 +2486,13 @@ function! s:Path.getSortOrderIndex() return s:NERDTreeSortStarIndex endfunction + +"FUNCTION: Path.isUnixHiddenFile() {{{3 +"check for unix hidden files +function! s:Path.isUnixHiddenFile() + return self.getLastPathComponent(0) =~# '^\.' +endfunction + "FUNCTION: Path.ignore() {{{3 "returns true if this path should be ignored function! s:Path.ignore() @@ -2499,7 +2506,7 @@ function! s:Path.ignore() endif "dont show hidden files unless instructed to - if b:NERDTreeShowHidden ==# 0 && self.getLastPathComponent(0) =~# '^\.' + if b:NERDTreeShowHidden ==# 0 && self.isUnixHiddenFile() return 1 endif @@ -2999,7 +3006,7 @@ function! s:findAndRevealPath() return endtry - if p.getLastPathComponent(0) =~# '^\.' + if p.isUnixHiddenFile() let showhidden=g:NERDTreeShowHidden let g:NERDTreeShowHidden = 1 endif @@ -3029,7 +3036,7 @@ function! s:findAndRevealPath() call s:putCursorInTreeWin() call b:NERDTreeRoot.reveal(p) - if p.getLastPathComponent(0) =~# '^\.' + if p.isUnixHiddenFile() let g:NERDTreeShowHidden = showhidden endif endfunction