commit 5e8aa9e721235daf49e79b341afc2f8eeff091a4
parent 74be22deb7690d847146bd8e52853362b56c82e2
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date: Thu, 14 Feb 2019 17:44:31 -0500
Confirm the wipeout of a unsaved buffer whose file has been renamed. (#949)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim
@@ -108,7 +108,11 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
" 3. We don't need a previous buffer anymore
- exec "bwipeout! " . a:bufNum
+ try
+ exec "confirm bwipeout " . a:bufNum
+ catch
+ " This happens when answering Cancel if confirmation is needed. Do nothing.
+ endtry
endfunction
"FUNCTION: NERDTreeAddNode(){{{1
function! NERDTreeAddNode()