FIX: Avoid error for recursive :redir. #8

Merged
merged 1 commit into from Aug 13, 2012

Conversation

Projects
None yet
2 participants
@inkarkat
Contributor

inkarkat commented Aug 12, 2012

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!.

FIX: Avoid error for recursive :redir.
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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Aug 13, 2012

Owner

Nice catch, thanks! I'll merge it.

Owner

chrisbra commented Aug 13, 2012

Nice catch, thanks! I'll merge it.

chrisbra added a commit that referenced this pull request Aug 13, 2012

Merge pull request #8 from inkarkat/swapname-recursive-redir
FIX: Avoid error for recursive :redir.

@chrisbra chrisbra merged commit 6ceebb8 into chrisbra:master Aug 13, 2012

@inkarkat inkarkat deleted the inkarkat:swapname-recursive-redir branch May 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment