Skip to content

Commit

Permalink
fix the mouse and NERDTreeDirArrows
Browse files Browse the repository at this point in the history
  • Loading branch information
scrooloose committed Apr 23, 2011
1 parent f621df6 commit 2e072fe
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugin/NERD_tree.vim
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ endif
let s:NERDTreeBufName = '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)'

"the number to add to the nerd tree buffer name to make the buf name unique
Expand Down Expand Up @@ -3672,19 +3672,17 @@ function! s:checkForActivate()
let currentNode = s:TreeFileNode.GetSelected()
if currentNode != {}
let startToCur = strpart(getline(line(".")), 0, col("."))
let char = strpart(startToCur, strlen(startToCur)-1, 1)

"if they clicked a dir, check if they clicked on the + or ~ sign
"beside it
if currentNode.path.isDirectory
if startToCur =~# s:tree_markup_reg . '$' && char =~# '[+~]'
if startToCur =~# s:tree_markup_reg . '$' && startToCur =~# '[+~▾▸]$'
call s:activateNode(0)
return
endif
endif

if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
if char !~# s:tree_markup_reg && startToCur !~# '\/$'
let char = strpart(startToCur, strlen(startToCur)-1, 1)
if char !~# s:tree_markup_reg
call s:activateNode(0)
return
endif
Expand Down

0 comments on commit 2e072fe

Please sign in to comment.