Skip to content

Commit 36cd8bf

Browse files
committed
Merge pull request preservim#202 from techlivezheng/feature/find-hidden-file
Make NERDTreeFind work on hidden files
2 parents 22de74a + ce6c347 commit 36cd8bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugin/NERD_tree.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2999,6 +2999,11 @@ function! s:findAndRevealPath()
29992999
return
30003000
endtry
30013001

3002+
if p.getLastPathComponent(0) =~# '^\.'
3003+
let showhidden=g:NERDTreeShowHidden
3004+
let g:NERDTreeShowHidden = 1
3005+
endif
3006+
30023007
if !s:treeExistsForTab()
30033008
try
30043009
let cwd = s:Path.New(getcwd())
@@ -3023,6 +3028,10 @@ function! s:findAndRevealPath()
30233028
endif
30243029
call s:putCursorInTreeWin()
30253030
call b:NERDTreeRoot.reveal(p)
3031+
3032+
if p.getLastPathComponent(0) =~# '^\.'
3033+
let g:NERDTreeShowHidden = showhidden
3034+
endif
30263035
endfunction
30273036

30283037
" FUNCTION: s:has_opt(options, name) {{{2

0 commit comments

Comments
 (0)