Merge pull request #822 from scrooloose/821-better_delete_confirmation

If node isn't open, count children on disk before deleting.
This commit is contained in:
Phil Runninger
2018-04-02 14:01:00 -04:00
committed by GitHub

View File

@@ -175,7 +175,8 @@ function! NERDTreeDeleteNode()
let currentNode = g:NERDTreeFileNode.GetSelected()
let confirmed = 0
if currentNode.path.isDirectory && currentNode.getChildCount() > 0
if currentNode.path.isDirectory && ((currentNode.isOpen && currentNode.getChildCount() > 0) ||
\ (len(currentNode._glob('*', 1)) > 0))
let choice =input("Delete the current node\n" .
\ "==========================================================\n" .
\ "STOP! Directory is not empty! To delete, type 'yes'\n" .