[ESS] Indentation of continued statements

Andreas Leha andreas.leha at med.uni-goettingen.de
Thu Apr 24 10:18:55 CEST 2014


Hi all,

Vitalie Spinu <spinuvit at gmail.com> writes:

> Sorry,  I thought I have answered this one.
>
> There is no way to change this behavior, it's hard-coded. We are aware
> of this issue but never bothered to dig into it as the indentation code
> is a bit stuffy.
>
> I agree with your point on consistency, but what the default should be?
> I personally quite like the shifted version as it is indicative of the
> "continuation" line.
>
>   Vitalie
>
>  >>> Ali Tofigh on Thu, 24 Apr 2014 00:23:31 -0400 wrote:
>
>  > no takers?
>  > /ali
>
>  > On Tue, Apr 15, 2014 at 6:59 PM, Ali Tofigh <alix.tofigh at gmail.com> wrote:
>  >> When writing R code with ess-style set to C++, continued statements
>  >> are indented like this in the outermost level:
>  >> 
>  >> 1 +
>  >> 2 +
>  >> 3 +
>  >> 4
>  >> 
>  >> However, inside braces (for example inside function definitions),
>  >> continued statements are indented like this:
>  >> 
>  >> {
>  >> 1 +
>  >> 2 +
>  >> 3 +
>  >> 4
>  >> }
>  >> 
>  >> Is there a way of getting the same indentation as the outermost level
>  >> everywhere? I've experimented with all the style variables, but
>  >> nothing seems to work. I don't really see why the two cases should be
>  >> indented differently.
>  >> 
>  >> /ali
>


FWIW, I would also welcome improved indentation here.  Since
this seems to be an issue of 'personally quite like', this really should
not be hard coded but configurable IMO.

I see that since this does not affect functionality, it has no high
priority, though.

Regards,
Andreas


PS: 
My use cases are often ggplots with long continuations like:
  ggplot(data, aes(x=x, y=y)) +
    geom_boxplot() +
    facet_grid() +
    xlab() +
    theme()



More information about the ESS-help mailing list