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

BUGFIX: Repair a problem with the 'u' mapping. #838

Merged
merged 1 commit into from
May 7, 2018

Conversation

lifecrisis
Copy link
Contributor

See commit message.

This commit refactors the "nerdtree#ui_glue#UpDir()" function to fix
a bug in the behavior of the 'u' mapping.  To reproduce the bug:

  1. Open a bookmarked directory with 'o'
  2. Press 'u' twice, observing normal behavior
  3. Open the same bookmark again with 'o'
  4. Press 'u' again, observe the new root is closed

The reason for this bug is that the parent node already existed and
was closed by the second 'u' press in step two above.

This commit fixes this bug by being careful to always open the new
root and transplant the child node properly.  Also, the internals of
the function in question were refactored to make use of valuable
NERDTree functions that ultimately help to reduce the amount of code
needed for this operation.
@lifecrisis lifecrisis merged commit 6188c5e into preservim:master May 7, 2018
@lifecrisis lifecrisis deleted the updir-fix branch May 7, 2018 12:23
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