From d769e460110784772a86a79ae0cce5c760410a20 Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Thu, 18 Jun 2015 17:04:36 +0000 Subject: [PATCH] Fail gracefully when saving register contents Fixes #37 --- plugin/exchange.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/exchange.vim b/plugin/exchange.vim index 4c6dd9a..54d0ca1 100644 --- a/plugin/exchange.vim +++ b/plugin/exchange.vim @@ -163,7 +163,11 @@ function! s:exchange_clear(...) endfunction function! s:save_reg(name) - return [getreg(a:name), getregtype(a:name)] + try + return [getreg(a:name), getregtype(a:name)] + catch /.*/ + return ['', ''] + endtry endfunction function! s:restore_reg(name, reg)