Indent wierdness.
Hugh Sasse
hgs at dmu.ac.uk
Thu Oct 20 18:29:09 EDT 2005
On Fri, 21 Oct 2005, Nikolai Weibull wrote:
> 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.
Ok, that makes sense.
>
> So don't write it in the shrivelled-up-Iâm-in-a-book kind of way;
:-) I pasted it from the web.
> instead, write it as:
>
>
> def metaclass
> class << self; self; end
> end
that'w what I did and it works for that case.
>
> 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\)\>'
OK, I don't knwo when I'll get chance to explore this, but now
you've told me what to look at it is much more feasible for me.
Thank you.
>
> 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
>
Thank you,
Hugh
More information about the vim-ruby-devel
mailing list