Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

FIX: Avoid error for recursive :redir. #8

Merged
merged 1 commit into from over 1 year ago

2 participants

Ingo Karkat chrisbra
Ingo Karkat

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

Ingo Karkat 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!.
c21eb5f
chrisbra
Owner

Nice catch, thanks! I'll merge it.

chrisbra chrisbra merged commit 6ceebb8 into from August 13, 2012
chrisbra chrisbra closed this August 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 12, 2012
Ingo Karkat 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!.
c21eb5f
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  autoload/recover.vim
2  autoload/recover.vim
@@ -30,7 +30,7 @@ fu! recover#Recover(on) "{{{1
30 30
 endfu
31 31
 
32 32
 fu! s:Swapname() "{{{1
33  
-    redir => a |sil swapname|redir end
  33
+    sil! redir => a |sil swapname|redir end
34 34
     if a[1:] == 'No swap file'
35 35
 	return ''
36 36
     else
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.