nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 2b2b35ceda038d695e9d8d158c93aa1b81bac110
parent 7ed79c00c1e225003ab95803fe8a64de753dd8aa
Author: Jason Franklin <j_fra@fastmail.us>
Date:   Fri, 30 Jun 2017 10:10:26 -0400

Fix an inaccurate version check

Calling the function "globpath()" is complex when one is trying to
support multiple versions of Vim because this particular function
developed rapidly (as did "glob()") during the life of Vim 7.0.

This commit makes the version check for calling "globpath()" much
clearer. It also allows for rendering dead links in the NERDTree by
changing the "globpath()" call for versions of Vim that include
patch 7.4.654. This can be done later when the effects are known and
the feature is officially requested.

Fixes #718.

Diffstat:
Mlib/nerdtree/tree_dir_node.vim | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -242,11 +242,13 @@ function! s:TreeDirNode._glob(pattern, all)
 
     let l:globList = []
 
-    " See ":h version7.txt" for the details of the progression of the "glob()"
-    " and "globpath()" functions.
-    if v:version >= 704
+    " See ":h version7.txt" and ":h version8.txt" for details on the
+    " development of the "glob()" and "globpath()" functions.
+    if v:version > 704 || (v:version == 704 && has('patch654'))
+        let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1, 0)
+    elseif v:version == 704 && has('patch279')
         let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1)
-    elseif v:version >= 703
+    elseif v:version > 702 || (v:version == 702 && has('patch051'))
         let l:globString = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore)
         let l:globList = split(l:globString, "\n")
     else