Indent wierdness.
Nikolai Weibull
mailing-lists.vim-ruby-development at rawuncut.elitemail.org
Thu Oct 20 18:04:10 EDT 2005
Hugh Sasse wrote:
> def metaclass; class << self; self; end; end
Problem with counting of def and class versus ends. We only see things
at the beginning of the line.
So don't write it in the shrivelled-up-I’m-in-a-book kind of way;
instead, write it as:
def metaclass
class << self; self; end
end
That won’t fool the indenter. Perhaps we can rewrite the regular
expressions to do this kind of stuff, but I don’t remember if there were
issues with doing so.
If you want, please try redefining s:end_start_regex so that it can find
the ‘class’ in the above example as well. That’d solve a lot of issues.
Perhaps my reasoning has been far too restrictive when it comes to that
variable. You can try something like
let s:end_start_regex = '\%(^\|[^.:]\)\@<=\<\%(module\|class\|def\|if' .
\ '\|for\|while\|until\|case\|unless\|begin\|do\)\>'
and report back on how that works. It solves the issues you were having
now, but please verify that it doesn’t introduce something nasty....
Thanks,
nikolai
--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
More information about the vim-ruby-devel
mailing list