nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit a7f9abe8276e6138e1e7056635030a15a1d600fc
parent 41029aef24baf855f6785fdd2201db58bf2a6aa7
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Mon, 20 Jul 2009 01:01:12 +1200

fix a bug where the ../ and ./ entries werent being filtered out

Diffstat:
Mplugin/NERD_tree.vim | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -1256,7 +1256,7 @@ function! s:TreeDirNode._initChildren(silent)
         "filter out the .. and . directories
         "Note: we must match .. AND ../ cos sometimes the globpath returns
         "../ for path with strange chars (eg $)
-        if i !~ '^\.\.\/\?$' && i !~ '^\.\/\?$'
+        if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
 
             "put the next file in a new node and attach it
             try
@@ -1373,7 +1373,10 @@ function! s:TreeDirNode.refresh()
         let filesStr = globpath(dir.strForGlob(), '*') . "\n" . globpath(dir.strForGlob(), '.*')
         let files = split(filesStr, "\n")
         for i in files
-            if i !~ '\.\.$' && i !~ '\.$'
+            "filter out the .. and . directories
+            "Note: we must match .. AND ../ cos sometimes the globpath returns
+            "../ for path with strange chars (eg $)
+            if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
 
                 try
                     "create a new path and see if it exists in this nodes children