PATCH: use new CompilerSet command for compiler plugins
Doug Kearns
djkea2 at mugca.its.monash.edu.au
Sun Sep 5 01:50:23 EDT 2004
Index: compiler/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/compiler/ruby.vim,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- compiler/ruby.vim 3 Sep 2003 03:46:52 -0000 1.6
+++ compiler/ruby.vim 4 Sep 2004 10:30:13 -0000 1.7
@@ -2,7 +2,7 @@
" Language: Ruby
" Function: Syntax check and/or error reporting
" Maintainer: Tim Hammerquist <timh at rubyforge.org>
-" Info: $Id: ruby.vim,v 1.6 2003/09/03 03:46:52 dkearns Exp $
+" Info: $Id: ruby.vim,v 1.7 2004/09/04 10:30:13 dkearns Exp $
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Licence: GPL (http://www.gnu.org)
@@ -32,28 +32,31 @@
" This is my first experience with 'errorformat' and compiler plugins and
" I welcome any input from more experienced (or clearer-thinking)
" individuals.
-" ----------------------------------------------------------------------------
if exists("current_compiler")
finish
endif
let current_compiler = "ruby"
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
let s:cpo_save = &cpo
set cpo-=C
" default settings runs script normally
" add '-c' switch to run syntax check only:
"
-" setlocal makeprg=ruby\ -wc\ $*
+" CompilerSet makeprg=ruby\ -wc\ $*
"
" or add '-c' at :make command line:
"
" :make -c %<CR>
"
-setlocal makeprg=ruby\ -w\ $*
+CompilerSet makeprg=ruby\ -w\ $*
-setlocal errorformat=
+CompilerSet errorformat=
\%+E%f:%l:\ parse\ error,
\%W%f:%l:\ warning:\ %m,
\%E%f:%l:in\ %*[^:]:\ %m,
Index: compiler/rubyunit.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/compiler/rubyunit.vim,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- compiler/rubyunit.vim 19 May 2004 07:57:57 -0000 1.3
+++ compiler/rubyunit.vim 4 Sep 2004 10:30:13 -0000 1.4
@@ -1,7 +1,7 @@
" Vim compiler file
" Language: Test::Unit - Ruby Unit Testing Framework
" Maintainer: Doug Kearns <djkea2 at mugca.its.monash.edu.au>
-" Info: $Id: rubyunit.vim,v 1.3 2004/05/19 07:57:57 dkearns Exp $
+" Info: $Id: rubyunit.vim,v 1.4 2004/09/04 10:30:13 dkearns Exp $
" URL: http://vim-ruby.sourceforge.net
" Anon CVS: See above site
" Licence: GPL (http://www.gnu.org)
@@ -17,21 +17,25 @@
endif
let current_compiler = "rubyunit"
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
let s:cpo_save = &cpo
set cpo-=C
-setlocal makeprg=ruby
+CompilerSet makeprg=ruby
-setlocal errorformat=\%Etest%[%^\ ]%#(%[%^\ ]%#)\ [%f:%l]:,
- \%E\ %\\+%f:%l:in\ %.%#,
- \%Z%m%\\%.,
- \%C%m%\\%.,
- \%-GLoaded%.%#,
- \%-GStarted%.%#,
- \%-G%[EF%.]%.%#,
- \%-GFinished\ in%.%#,
- \%-G\ %\\+%\\d%\\+)\ Failure:,
- \%-G\ %\\+%\\d%\\+)\ Error:
+CompilerSet errorformat=\%Etest%[%^\ ]%#(%[%^\ ]%#)\ [%f:%l]:,
+ \%E\ %\\+%f:%l:in\ %.%#,
+ \%Z%m%\\%.,
+ \%C%m%\\%.,
+ \%-GLoaded%.%#,
+ \%-GStarted%.%#,
+ \%-G%[EF%.]%.%#,
+ \%-GFinished\ in%.%#,
+ \%-G\ %\\+%\\d%\\+)\ Failure:,
+ \%-G\ %\\+%\\d%\\+)\ Error:
let &cpo = s:cpo_save
unlet s:cpo_save
More information about the vim-ruby-devel
mailing list