1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:10:06 +08:00

fix(nerdtree): fix Enter key binding of nerdtree

This commit is contained in:
Eric Wong 2024-06-09 18:22:17 +08:00
parent 1cd8341200
commit e9cc0e46f7

View File

@ -94,10 +94,13 @@ function! s:nerdtree_dot() abort
endfunction
function! s:nerdtree_enter() abort
let path = g:NERDTreeFileNode.GetSelected().path.str()
if isdirectory(path)
silent! exe 'NERDTree' g:NERDTreeFileNode.GetSelected().path.str()
else
call g:NERDTreeKeyMap.Invoke('o')
let node = g:NERDTreeFileNode.GetSelected()
if has_key(node, 'path')
let path = node.path.str()
if isdirectory(path)
silent! exe 'NERDTree' g:NERDTreeFileNode.GetSelected().path.str()
else
call g:NERDTreeKeyMap.Invoke('o')
endif
endif
endfunction