Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If node isn't open, count children on disk before deleting. #822

Merged
merged 1 commit into from
Apr 2, 2018

Conversation

PhilRunninger
Copy link
Member

Fixes #821. If a node isn't opened in NERDTree, it's children aren't
known yet, so when deleting the node (with m, d), the user isn't
properly asked to confirm the delete. It was going to the less strict
Y/n confirmation, instead of the yes confirmation for non-empty
directories.

This change checks to see if the node is opened already. If it is, the
existing getChildCount() function is used; otherwise, the disk is read
to get the number of children there.

Fixes #821. If a node isn't opened in NERDTree, it's children aren't
known yet, so when deleting the node (with `m`, `d`), the user isn't
properly asked to confirm the delete. It was going to the less strict
`Y`/`n` confirmation, instead of the `yes` confirmation for non-empty
directories.

This change checks to see if the node is opened already. If it is, the
existing getChildCount() function is used; otherwise, the disk is read
to get the number of children there.
@SammysHP
Copy link

SammysHP commented Apr 2, 2018

Tested and it works fine.

@PhilRunninger PhilRunninger merged commit a0e49c9 into master Apr 2, 2018
@PhilRunninger PhilRunninger deleted the 821-better_delete_confirmation branch April 2, 2018 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants