chrisbra / Recover.vim

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

FIX: Avoid error for recursive :redir. #8

Closed inkarkat closed 12 years ago

inkarkat commented 12 years ago

The s:CheckSwapFileExists() may be triggered while a command or mapping runs that :redirs itself. Unfortunately, recursive :redir is not allowed, and Vim throws an error, which negatively affects the original command / mapping. This has actually been reported by a user of my EnhancedJumps plugin (vimscript #2695).

Since an occasionally failing swapfile check isn't tragic, let's just suppress the error via :silent!.

chrisbra commented 12 years ago

Nice catch, thanks! I'll merge it.