From 8b48413155832c6fd860636eada0e3b5ab74da07 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 26 Jun 2014 10:01:15 +0100 Subject: [PATCH] rename NERDTreeWildIgnore option and refactor the usage of it Rename it to the more intention revealing NERDTreeRespectWildIgnore. Use it directly in the `globpath()` call rather than surrounding if statement. Its subjective, but I find this clearer. Add an initializer for the option. --- doc/NERD_tree.txt | 4 ++-- lib/nerdtree/tree_dir_node.vim | 4 ++-- plugin/NERD_tree.vim | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index 99814ba..459f391 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -635,7 +635,7 @@ NERD tree. These options should be set in your vimrc. |'NERDTreeIgnore'| Tells the NERD tree which files to ignore. -|'NERDTreeWildIgnore'| Tells the NERD tree to respect |'wildignore'|. +|'NERDTreeRespectWildIgnore'| Tells the NERD tree to respect |'wildignore'|. |'NERDTreeBookmarksFile'| Where the bookmarks are stored. @@ -827,7 +827,7 @@ The file filters can be turned on and off dynamically with the |NERDTree-f| mapping. ------------------------------------------------------------------------------ - *'NERDTreeWildIgnore'* + *'NERDTreeRespectWildIgnore'* Values: 0 or 1. Default: 0. diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index d6a7c5f..3d23cca 100644 --- a/lib/nerdtree/tree_dir_node.vim +++ b/lib/nerdtree/tree_dir_node.vim @@ -228,8 +228,8 @@ function! s:TreeDirNode._initChildren(silent) let dir = self.path let globDir = dir.str({'format': 'Glob'}) - if version >= 703 && g:NERDTreeWildIgnore - let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1) + if version >= 703 + let filesStr = globpath(globDir, '*', !g:NERDTreeRespectWildIgnore) . "\n" . globpath(globDir, '.*', !g:NERDTreeRespectWildIgnore) else let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') endif diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index c3b9dfd..3b7db11 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -62,6 +62,7 @@ call s:initVariable("g:NERDTreeHijackNetrw", 1) call s:initVariable("g:NERDTreeMouseMode", 1) call s:initVariable("g:NERDTreeNotificationThreshold", 100) call s:initVariable("g:NERDTreeQuitOnOpen", 0) +call s:initVariable("g:NERDTreeRespectWildIgnore", 0) call s:initVariable("g:NERDTreeShowBookmarks", 0) call s:initVariable("g:NERDTreeShowFiles", 1) call s:initVariable("g:NERDTreeShowHidden", 0)