From 16268c9c21511ae1d2dcbc306266bb2daab49248 Mon Sep 17 00:00:00 2001 From: Joseph Thomson Date: Mon, 29 Oct 2012 16:30:29 +0000 Subject: [PATCH] Fix call to globpath() for Vim 7.2 and below. globpath() takes an extra optional parameter in Vim 7.3, but this breaks NERD tree on earlier versions. --- plugin/NERD_tree.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 88730bf..ad1669f 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -1618,7 +1618,13 @@ function! s:TreeDirNode._initChildren(silent) "get an array of all the files in the nodes dir let dir = self.path let globDir = dir.str({'format': 'Glob'}) - let filesStr = globpath(globDir, '*',1) . "\n" . globpath(globDir, '.*',1) + + if version >= 703 + let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1) + else + let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') + endif + let files = split(filesStr, "\n") if !a:silent && len(files) > g:NERDTreeNotificationThreshold