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

plugin: reset more while installing binaries #2457

Merged
merged 1 commit into from
Aug 18, 2019

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Aug 18, 2019

Reset 'more' while installing binaries. Set it back to its original
value before returning. If necessary, Vim will only prompt the user for
more once, at the end of the process instead of multiple times during.

@bhcleek bhcleek changed the title plugin: set reset more while installing binaries plugin: reset more while installing binaries Aug 18, 2019
Reset 'more' while installing binaries. Set it back to its original
value before returning. If necessary, Vim will only prompt the user for
more once, at the end of the process instead of multiple times during.
@bhcleek bhcleek merged commit 7731fe6 into fatih:master Aug 18, 2019
@bhcleek bhcleek deleted the plugin/once-more branch August 18, 2019 19:29
bhcleek added a commit that referenced this pull request Aug 18, 2019
@arp242
Copy link
Contributor

arp242 commented Aug 20, 2019

You should really use try .. finally for this kind of stuff, as returning or errors inside the function means the reset will never be called. Same applies for some other stuff that gets reset in this function.

@bhcleek
Copy link
Collaborator Author

bhcleek commented Aug 20, 2019

True. I made this decision deliberately, because there are no returns between the new statements and this code is getting a refactor soon anyway.

@arp242
Copy link
Contributor

arp242 commented Aug 20, 2019

All these external commands – many of which access the network – are very apt to failure, so returning early is probably happening for some people.

Why "deliberately" write code with a predisposition for buggy behaviour if it's just as much effort to do it in a non-buggy way? I don't understand this at all... It's not a massive refactor we're talking about here, just a wrapping in a try..finally block. In a previous change you put Restore_modules just outside of an existing try block ... :-/

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.

None yet

2 participants