Browse files

fix the mouse and NERDTreeDirArrows

  • Loading branch information...
1 parent f621df6 commit 2e072fe0e23a92c75f08cae04cb50ed4212b79f6 @scrooloose scrooloose committed Apr 24, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 plugin/NERD_tree.vim
View
10 plugin/NERD_tree.vim
@@ -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
@@ -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

0 comments on commit 2e072fe

Please sign in to comment.