Fail gracefully when saving register contents

Fixes #37
This commit is contained in:
Tom McDonald 2015-06-18 17:04:36 +00:00
parent 5a8e725a64
commit d769e46011

View File

@ -163,7 +163,11 @@ function! s:exchange_clear(...)
endfunction endfunction
function! s:save_reg(name) function! s:save_reg(name)
return [getreg(a:name), getregtype(a:name)] try
return [getreg(a:name), getregtype(a:name)]
catch /.*/
return ['', '']
endtry
endfunction endfunction
function! s:restore_reg(name, reg) function! s:restore_reg(name, reg)