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:
class << self; self; 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' .
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....