Avoid aborting the diff when buffer was opened under try..catch. #10

Merged
merged 1 commit into from Aug 13, 2012

Projects

None yet

2 participants

@inkarkat
Contributor

I use a custom :Drop command (that does some more magic), and use that almost exclusively to open files in Vim. Effectively, an :edit / :split command is issued under a try..catch block to catch and gracefully report any errors that occur during file open. Unfortunately, the try..catch changes the semantics inside s:CheckRecover(). When the :recover there fails with an E305, instead of continuing with the diff-split, the execution is aborted, and the plugin doesn't work for me.

The fix is to add a try..catch around :recover. It keeps the verbose recovery messages visible, so that there is still an indication when recovery failed.

@inkarkat inkarkat Avoid aborting the diff when buffer was opened under try..catch.
I use a custom :Drop command (that does some more magic), and use that almost exclusively to open files in Vim. Effectively, an :edit / :split command is issued under a try..catch block to catch and gracefully report any errors that occur during file open. Unfortunately, the try..catch changes the semantics inside s:CheckRecover(). When the :recover there fails with an E305, instead of continuing with the diff-split, the execution is aborted, and the plugin doesn't work for me.

The fix is to add a try..catch around :recover. It keeps the verbose recovery messages visible, so that there is still an indication when recovery failed.
d0d7e25
@chrisbra
Owner

thanks!

@chrisbra chrisbra merged commit 308924c into chrisbra:master Aug 13, 2012
@inkarkat inkarkat deleted the inkarkat:avoid-recover-abort branch May 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment