Don't ignore events when opening renamed files.

This commit is contained in:
Phil Runninger 2020-01-16 11:17:33 -05:00
parent 5fbf0d7dba
commit 3a3636b7cb

View File

@ -141,12 +141,12 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
endif
" 1. ensure that a new buffer is loaded
call nerdtree#exec('badd ' . quotedFileName, 1)
call nerdtree#exec('badd ' . quotedFileName, 0)
" 2. ensure that all windows which display the just deleted filename
" display a buffer for a new filename.
let s:originalTabNumber = tabpagenr()
let s:originalWindowNumber = winnr()
call nerdtree#exec('tabdo windo if winbufnr(0) ==# ' . a:bufNum . " | exec ':e! " . editStr . "' | endif", 1)
call nerdtree#exec('tabdo windo if winbufnr(0) ==# ' . a:bufNum . " | exec ':e! " . editStr . "' | endif", 0)
call nerdtree#exec('tabnext ' . s:originalTabNumber, 1)
call nerdtree#exec(s:originalWindowNumber . 'wincmd w', 1)
" 3. We don't need a previous buffer anymore