Skip to content

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

Merged
chrisbra merged 1 commit into
chrisbra:masterfrom
inkarkat:avoid-recover-abort
Aug 13, 2012
Merged

Avoid aborting the diff when buffer was opened under try..catch.#10
chrisbra merged 1 commit into
chrisbra:masterfrom
inkarkat:avoid-recover-abort

Conversation

@inkarkat

Copy link
Copy Markdown
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.

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.
@chrisbra

Copy link
Copy Markdown
Owner

thanks!

chrisbra added a commit that referenced this pull request Aug 13, 2012
Avoid aborting the diff when buffer was opened under try..catch.
@chrisbra chrisbra merged commit 308924c into chrisbra:master Aug 13, 2012
@inkarkat inkarkat deleted the avoid-recover-abort branch May 9, 2014 07:39
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