commit 283559bd97f3431bf1fe3fde98e4f1416ce30372
parent 38442b06d47eb70d19f81cf7bd0739305bc7bb68
Author: Martin Grenfell <martin_grenfell@msn.com>
Date: Sun, 19 Oct 2008 23:06:32 +1300
fix a bug where directories starting with + couldnt be opened
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -132,7 +132,7 @@ let s:escape_chars = " \\`\|\"#%&,?()\*^<>"
let s:NERDTreeWinName = '_NERD_tree_'
let s:tree_wid = 2
-let s:tree_markup_reg = '[ \-+~`|]'
+let s:tree_markup_reg = '^[ `|]*[\-+~]'
let s:tree_up_dir_line = '.. (up a dir)'
let s:os_slash = '/'
@@ -140,7 +140,6 @@ if s:running_windows
let s:os_slash = '\'
endif
-
" SECTION: Commands {{{1
"============================================================
"init the command that users start the nerd tree with
@@ -2727,7 +2726,7 @@ endfunction
function! s:stripMarkupFromLine(line, removeLeadingSpaces)
let line = a:line
"remove the tree parts and the leading space
- let line = substitute (line,"^" . s:tree_markup_reg . "*","","")
+ let line = substitute (line, s:tree_markup_reg,"","")
"strip off any read only flag
let line = substitute (line, ' \[RO\]', "","")
@@ -2906,8 +2905,7 @@ function! s:checkForActivate()
"if they clicked a dir, check if they clicked on the + or ~ sign
"beside it
if currentNode.path.isDirectory
- let reg = '^' . s:tree_markup_reg .'*[~+]$'
- if startToCur =~ reg
+ if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]'
call s:activateNode(0)
return
endif