Issue 315 - Incorrect buffer deleted on file delete

This commit is contained in:
aramasamy
2014-02-21 00:46:15 +00:00
parent b0bb781fc7
commit 13b4058f2f

View File

@@ -138,7 +138,7 @@ function! NERDTreeMoveNode()
endif endif
try try
let bufnum = bufnr(curNode.path.str()) let bufnum = bufnr("^".curNode.path.str()."$")
call curNode.rename(newNodePath) call curNode.rename(newNodePath)
call NERDTreeRender() call NERDTreeRender()
@@ -186,7 +186,7 @@ function! NERDTreeDeleteNode()
"if the node is open in a buffer, ask the user if they want to "if the node is open in a buffer, ask the user if they want to
"close that buffer "close that buffer
let bufnum = bufnr(currentNode.path.str()) let bufnum = bufnr("^".currentNode.path.str()."$")
if buflisted(bufnum) if buflisted(bufnum)
let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)" let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
call s:promptToDelBuffer(bufnum, prompt) call s:promptToDelBuffer(bufnum, prompt)