nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 3be5f5ddd86d27ecf364add831c1d60f4b4ef984
parent a55e9eca405ff15a65d59554d9d1d1f8cdcfbdd8
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date:   Wed,  4 Jan 2012 13:52:44 +0000

fix a bug for files that begin with +/-/~ chars

First, set the tree parts regex appropriately depending on
g:NERDTreeDirArrows.

Second, fix an edge case when trying to edit a file like +foo where the
+ meant 'foo' was being interpreted as an arg to the :edit cmd

Diffstat:
Mplugin/NERD_tree.vim | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -149,7 +149,12 @@ endif
 let s:NERDTreeBufName = 'NERD_tree_'
 
 let s:tree_wid = 2
-let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]\+'
+
+if g:NERDTreeDirArrows
+    let s:tree_markup_reg = '^ *\([▾▸] \)\?'
+else
+    let s:tree_markup_reg = '^[ `|]*[\-+~]'
+endif
 let s:tree_up_dir_line = '.. (up a dir)'
 
 "the number to add to the nerd tree buffer name to make the buf name unique
@@ -2532,6 +2537,12 @@ function! s:Path._strForEdit()
     "return a relative path if we can
     if stridx(p, cwd) ==# 0
         let p = strpart(p, strlen(cwd))
+
+        "handle the edge case where the file begins with a + (vim interprets
+        "the +foo in `:e +foo` as an option to :edit)
+        if p[0] == "+"
+            let p = '\' . p
+        endif
     endif
 
     if p ==# ''