fix a bug where directories starting with + couldnt be opened
This commit is contained in:
parent
38442b06d4
commit
283559bd97
@ -132,7 +132,7 @@ let s:escape_chars = " \\`\|\"#%&,?()\*^<>"
|
|||||||
let s:NERDTreeWinName = '_NERD_tree_'
|
let s:NERDTreeWinName = '_NERD_tree_'
|
||||||
|
|
||||||
let s:tree_wid = 2
|
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:tree_up_dir_line = '.. (up a dir)'
|
||||||
|
|
||||||
let s:os_slash = '/'
|
let s:os_slash = '/'
|
||||||
@ -140,7 +140,6 @@ if s:running_windows
|
|||||||
let s:os_slash = '\'
|
let s:os_slash = '\'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" SECTION: Commands {{{1
|
" SECTION: Commands {{{1
|
||||||
"============================================================
|
"============================================================
|
||||||
"init the command that users start the nerd tree with
|
"init the command that users start the nerd tree with
|
||||||
@ -2727,7 +2726,7 @@ endfunction
|
|||||||
function! s:stripMarkupFromLine(line, removeLeadingSpaces)
|
function! s:stripMarkupFromLine(line, removeLeadingSpaces)
|
||||||
let line = a:line
|
let line = a:line
|
||||||
"remove the tree parts and the leading space
|
"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
|
"strip off any read only flag
|
||||||
let line = substitute (line, ' \[RO\]', "","")
|
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
|
"if they clicked a dir, check if they clicked on the + or ~ sign
|
||||||
"beside it
|
"beside it
|
||||||
if currentNode.path.isDirectory
|
if currentNode.path.isDirectory
|
||||||
let reg = '^' . s:tree_markup_reg .'*[~+]$'
|
if startToCur =~ s:tree_markup_reg . '$' && char =~ '[+~]'
|
||||||
if startToCur =~ reg
|
|
||||||
call s:activateNode(0)
|
call s:activateNode(0)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user