From: Rudolf Polzer Date: 2003-08-17T02:16:09+09:00 Subject: Re: list of Ruby capable text editors? Scripsit ille aut illa �Mauricio Fern�ndez� : > On Sat, Aug 16, 2003 at 10:55:41PM +0900, Rudolf Polzer wrote: > > elvis doesn't have ANY Ruby syntax highlighting and vim's doesn't work in > > the case > [nit-picking] > well, in this case Ruby thinks like vim :) > batsman@tux-chan:/tmp$ expand -t4 t.rb > def foo() > return if true > 23 > else > 42 > end > end > > p foo > batsman@tux-chan:/tmp$ ruby t.rb > t.rb:6: warning: else without rescue is useless > t.rb:7: syntax error Oops... that's what I get for making the "simplest possible example". > However > a = if true > 1 > else > 2 > end > fails as you describe. And that's what I really wrote... but thanks, that should explain why vim is doing that wrong. And that it's probably not easy to fix so that both if-suffixes and if-expressions are highlighted correctly. Hm... it can even be ambigous: puts foo if true 17 else 42 end does NOT what one might expect. The if is seen as a one-line if. There's no if-expression for the first argument of foo like in puts foo(if true 17 else 42 end) -- Can't find string terminator "EOF" anywhere before EOF at ./autoindex line 27.