From 5e8aa9e721235daf49e79b341afc2f8eeff091a4 Mon Sep 17 00:00:00 2001 From: Phil Runninger Date: Thu, 14 Feb 2019 17:44:31 -0500 Subject: [PATCH] Confirm the wipeout of a unsaved buffer whose file has been renamed. (#949) --- nerdtree_plugin/fs_menu.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim index ef261ca..5dee680 100644 --- 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()