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

Catch all errors, not just NERDTree errors. #894

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

PhilRunninger
Copy link
Member

@PhilRunninger PhilRunninger commented Oct 9, 2018

Fixes #893

When middle-clicking, the s:TreeFileNode.GetSelected() function is
called along the way. If this is done outside of the NERDTree window,
there is no "b:NERDTree" variable, and the "E121: Undefined variable"
exception is thrown. This function was trying to catch only the NERDTree
specific errors; thus, it let the Undefined variable exception slip by.
This commit forces the function to catch all errors.

When middle-clicking, the s:TreeFileNode.GetSelected() function is
called along the way. If this is done outside of the NERDTree window,
there is not "b:NERDTree" variable, and the "E121: Undefined variable"
exception is thrown. This function was trying to catch only the NERDTree
specific errors; thus, it let the Undefined variable exception slip by.
This commit causes the function to catch all errors.
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 don't think this is the correct solution. I'll add a comment below explaining my reasoning.

@lifecrisis
Copy link
Contributor

@PhilRunninger, I did some more digging, and I actually think this is okay. The problem is Vim.

The <MiddleMouse> key doesn't properly adjust window focus before performing its action. This is problematic when <MiddleMouse> has distinct buffer-local and global behaviors.

So, I rescind my earlier comment. I approve of your change, here!

@PhilRunninger PhilRunninger merged commit 820955e into master Oct 18, 2018
@PhilRunninger PhilRunninger deleted the middle_click_file_window_#893 branch October 18, 2018 15:35
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