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:
commit
a0e49c9b11
@ -175,7 +175,8 @@ function! NERDTreeDeleteNode()
|
|||||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||||
let confirmed = 0
|
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" .
|
let choice =input("Delete the current node\n" .
|
||||||
\ "==========================================================\n" .
|
\ "==========================================================\n" .
|
||||||
\ "STOP! Directory is not empty! To delete, type 'yes'\n" .
|
\ "STOP! Directory is not empty! To delete, type 'yes'\n" .
|
||||||
|
Loading…
Reference in New Issue
Block a user