PATCH: loop bodies containing do..end blocks

Doug Kearns djkea2 at mugca.its.monash.edu.au
Mon Aug 18 19:25:41 EDT 2003


Loop bodies containing do...end blocks such as the example below were
highlighted incorrectly. I can't see any reason why rubyDoBlock and
rubyCurlyBlock shouldn't be contained here.

for th in threads
  Thread.start(th) do |t|
    t.join
    @wait_queue.push t
  end
end

Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.4
diff -u -r1.4 ruby.vim
--- syntax/ruby.vim	16 Aug 2003 12:09:24 -0000	1.4
+++ syntax/ruby.vim	18 Aug 2003 07:59:50 -0000
@@ -196,7 +196,7 @@
   syn region rubyNoDoBlock matchgroup=rubyControl start="\<\(case\|begin\)\>" start="^\s*\(if\|unless\)\>" start=";\s*\(if\|unless\)\>"hs=s+1 end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo fold
 
   " statement with optional *do*
-  syn region rubyOptDoBlock matchgroup=rubyControl start="\<for\>" start="^\s*\(while\|until\)\>" start=";\s*\(while\|until\)\>"hs=s+1 end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo,rubyDoBlock,rubyCurlyBlock fold
+  syn region rubyOptDoBlock matchgroup=rubyControl start="\<for\>" start="^\s*\(while\|until\)\>" start=";\s*\(while\|until\)\>"hs=s+1 end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo fold
 
   if !exists("ruby_minlines")
     let ruby_minlines = 50


More information about the vim-ruby-devel mailing list