Subject: bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 01 Sep 2021 11:53:16 +0200

Bozhidar Batsov <[email-masked]> writes:

> Sorry for the radio silence - I've been super busy lately. 
>
> It's hard for me to understand the indentation in the examples in the email
> (as it seems the same to me). Very simply put - the idea is to align multi-line
> chained calls on the `.`, as opposed to just nest them under the root receiver
> as we'd normally do.
>
> I think Dmitry implemented this great and it's behaving just as it's supposed
> to be behaving. Perhaps you misunderstood how this was supposed to
> behave? What's the indentation you expected? 

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

The examples were in HTML mail, so they were difficult to understand.

Emacs (with (setq ruby-align-chained-calls t)) currently aligns like
this:

some_variable.where
             .not(x: nil)
             .where(y: 2)

Which is correct.  However, when there's a mixture of keeping things on
one line and breaking, we get this:

some_variable.where.not(x: nil)
                   .where(y: 2)

I think the bug reporter wants:

some_variable.where.not(x: nil)
             .where(y: 2)

I.e., align multiline chained calls on the first dot, not the last?

(I don't know Ruby, so I have no opinion here.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no