diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index acc27ad..dadc97a 100644 --- 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