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

Unzoom NERDTree when opening a file #870

Merged
merged 2 commits into from
Sep 10, 2018
Merged

Conversation

PhilRunninger
Copy link
Member

Implements #15.

IF

  1. the user wants NERDTree to stay open (g:NERDTreeQuitOnOpen=0),
  2. the NERDTree is zoomed, and
  3. a file is opened with o, i, s, or t

THEN unzoom NERDTree first.

We don't need to unzoom NERDTree if it's going to be closed when opening a file, and chances are the user wants it to remain zoomed the next time it's opened anyway.

go, gi, gs, and T do not trigger this new behavior, because focus remains in the
NERDTree.

Phil Runninger (mac) added 2 commits August 7, 2018 09:00
'go' does not trigger this new behavior, because focus remains in the
NERDTree.
Copy link
Contributor

@lifecrisis lifecrisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine.

I'd suggest you consider what happens when opening a file leaves the current tab. Using t or using o when the file is already open in another tab will leave the current tab. It seems more natural to leave the NERDTree zoomed in the tab you left behind.

I don't use this feature, so I don't really care... I have my own plugin for adjusting the NERDTree's window size.

If the tab issue is not important to you, feel free to merge!

@PhilRunninger PhilRunninger merged commit 129a241 into master Sep 10, 2018
@PhilRunninger PhilRunninger deleted the undo_zoom_on_open branch September 10, 2018 10:34
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