Skip to content

Commit 2e072fe

Browse files
committed
fix the mouse and NERDTreeDirArrows
1 parent f621df6 commit 2e072fe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plugin/NERD_tree.vim

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ endif
149149
let s:NERDTreeBufName = 'NERD_tree_'
150150

151151
let s:tree_wid = 2
152-
let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]*'
152+
let s:tree_markup_reg = '^[ `|]*[\-+~▾▸ ]\+'
153153
let s:tree_up_dir_line = '.. (up a dir)'
154154

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

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

36863683
if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
3687-
if char !~# s:tree_markup_reg && startToCur !~# '\/$'
3684+
let char = strpart(startToCur, strlen(startToCur)-1, 1)
3685+
if char !~# s:tree_markup_reg
36883686
call s:activateNode(0)
36893687
return
36903688
endif

0 commit comments

Comments
 (0)