From 5e1e7f076e66ed3cd3bdea9054debeb7c5f2c0bc Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Wed, 21 Jan 2009 19:29:57 -0500 Subject: [PATCH] Make snapshots not error in vim built with -eval --- plugin/CSApprox.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/CSApprox.vim b/plugin/CSApprox.vim index 2fbf6b4..a9be8ec 100644 --- a/plugin/CSApprox.vim +++ b/plugin/CSApprox.vim @@ -765,11 +765,11 @@ function! s:CSApproxSnapshot(file, overwrite) let lines += [ ' syntax reset' ] let lines += [ 'endif' ] let lines += [ '' ] - let lines += [ 'let g:colors_name = ' . string(fnamemodify(file, ':t:r')) ] - let lines += [ '' ] let lines += [ 'if v:version < 700' ] + let lines += [ ' let g:colors_name = ' . string(fnamemodify(file, ':t:r')) ] let lines += [ ' command! -nargs=+ CSAHi exe "hi" substitute(substitute(, "undercurl", "underline", "g"), "guisp\\S\\+", "", "g")' ] let lines += [ 'else' ] + let lines += [ ' let g:colors_name = ' . string(fnamemodify(file, ':t:r')) ] let lines += [ ' command! -nargs=+ CSAHi exe "hi" ' ] let lines += [ 'endif' ] let lines += [ '' ] @@ -824,7 +824,9 @@ function! s:CSApproxSnapshot(file, overwrite) endfor let lines += [ 'endif' ] let lines += [ '' ] - let lines += [ 'delcommand CSAHi' ] + let lines += [ 'if 1' ] + let lines += [ ' delcommand CSAHi' ] + let lines += [ 'endif' ] call writefile(lines, file) finally let &t_Co = save_t_Co