GNU bug report logs -
#16182
24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Wed, 18 Dec 2013 03:56:02 UTC
Severity: minor
Found in version 24.3.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>> When I'm breaking line on argument list it's
>> because the line is too long. With indentation to the opened paren the
>> line stays long despite breaking the line.
>
> Like Stefan suggests, if the opened paren is immediately followed by a
> newline, the arguments will be indented less (but still indented by
> additional two columns, compared to the beginning of the statement).
I did not think about it before. It makes sense.
>> I think this is how vim indents ruby code by default.
> If that's true, could you point to:
>
> * Some other open source project or two using this style.
>
> * Some tutorial or step-by-step instruction for me to test this
> indentation in Vim. Do I need to install anything apart from the > > base
> distribution?
> Suppose I have the snippet of code typed out. What do I press next?
Actually that's not true. I was wrong. Sorry for the confusion.
>> I you ask me emacs can only support the indentation to the beginning
>> of the statement.
>
> I don't think it's sufficient, by itself.
>
> Take this example:
>
> current_user.statuses.find(params[:id]).update({
> user: current_user,
> text: params[:status]
> })
>
> Suppose `update' accepted a second argument, and we wanted to pass it
> here, on the next line after the hash. Which column would it be indented
> to? 0?
Yes it's not sufficient.
[Message part 2 (text/html, inline)]
This bug report was last modified 11 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.