mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 04:13:48 -05:00
Fix the e key mapping to use netrw if desired (#1031)
* Use :edit in openExplorer to allow NERDTreeHijackNetrw to do its thing. * Remove commented-out code. * Make `e` work on file nodes, opening a new NERDTree or netrw buffer. * Update change log.
This commit is contained in:
@@ -523,7 +523,8 @@ endfunction
|
||||
" Open an explorer window for this node in the previous window. The explorer
|
||||
" can be a NERDTree window or a netrw window.
|
||||
function! s:TreeDirNode.openExplorer()
|
||||
call self.open({'where': 'p'})
|
||||
execute "wincmd p"
|
||||
execute "edit ".self.path.str({'format':'Edit'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.openInNewTab(options) {{{1
|
||||
|
||||
@@ -246,6 +246,12 @@ function! s:TreeFileNode.openInNewTab(options)
|
||||
call self.open(extend({'where': 't'}, a:options))
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeFileNode.openExplorer()
|
||||
function! s:TreeFileNode.openExplorer()
|
||||
execute "wincmd p"
|
||||
execute "edit ".self.path.getParent().str({'format':'Edit'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{1
|
||||
" Places the cursor on the line number this node is rendered on
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user