1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +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 endfunction
function! s:nerdtree_enter() abort function! s:nerdtree_enter() abort
let path = g:NERDTreeFileNode.GetSelected().path.str() let node = g:NERDTreeFileNode.GetSelected()
if has_key(node, 'path')
let path = node.path.str()
if isdirectory(path) if isdirectory(path)
silent! exe 'NERDTree' g:NERDTreeFileNode.GetSelected().path.str() silent! exe 'NERDTree' g:NERDTreeFileNode.GetSelected().path.str()
else else
call g:NERDTreeKeyMap.Invoke('o') call g:NERDTreeKeyMap.Invoke('o')
endif endif
endif
endfunction endfunction