chrisbra / Recover.vim

A Plugin to show a diff, whenever recovering a buffer
http://www.vim.org/scripts/script.php?script_id=3068
247 stars 25 forks source link

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

Closed inkarkat closed 12 years ago

inkarkat commented 12 years ago

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 commented 12 years ago

thanks!