From: Joao Pedrosa Date: 2003-06-15T03:05:32+09:00 Subject: Re: I need a code beautifier or formatter Hi, Em Sáb, 2003-06-14 às 13:19, Mauricio Fernández escreveu: > On Sun, Jun 15, 2003 at 12:24:58AM +0900, Joao Pedrosa wrote: > > But it had some problem with > > > > ----- snip > > def listjoin(channels) > > channels.each do |c|^M > > s = "join ##{c}"^M > > @irconnector.sendToStatus s^M > > @irconnector.sendToServer s^M > > end^M > > end^M > > ----- snip > > I think I found the bug in indent/ruby.vim responsible for that (assuming > that you had in fact one or more spaces after '|c|' and before the EOL): > > --- ruby.vim.bak 2003-06-14 18:00:03.000000000 +0200 > +++ ruby.vim 2003-06-14 18:02:47.000000000 +0200 > @@ -52,7 +52,7 @@ > " Add a 'shiftwidth' after lines beginning with module, class, def,... > " or ending in {, do (with optional |...| and comment). > let begin_words = '(module|class|def|if|for|while|until|else|elsif|case|when|unless|begin|ensure|rescue)>' > - if line =~ '\v^\s*' . begin_words || line =~ '\v(\{|)\s*(\|[^|]*\|)?(\s*#.*)?$' > + if line =~ '\v^\s*' . begin_words || line =~ '\v(\{|)\s*(\|[^|]*\|)?\s*(#.*)?$' > let ind = ind + &sw > let flag = 1 > endif > > somebody (in fact, now I think it has happened to me in the past) could > put spaces after the block args. and indentation would bomb... Right on target :-) I am CCing to Gavin, as he probably would like to fix it. Thanks, Joao