Indentation in ESS is occasionally a little kooky, and I'm trying to figure out if the kookiness is a bug or a feature. How does one get proper indentation of parentheses after an "=" sign in ESS (say, in R-mode
)?
As an example, I'd expect indentation to look like this for the "labels" parameter:
somevar <- factor(x = 1:3,
labels = c("a",
"b",
"c"))
Instead, I get:
somevar <- factor(x = 1:3,
labels = c("a",
"b",
"c"))
This version (note the extra parentheses wrapped around the c(...)
expression) seems to work just fine, however:
somevar <- factor(x = 1:3,
labels = (c("a",
"b",
"c")))
This oddity only seems to occur if it's after the "=". How do I get the desired behavior? Am I missing some setting somewhere? (I hope so: wading through the source code for ess-indent-line
is not an explosion of joy.)
NOTE: I'd originally asked a version of this question on Stack Overflow about half a year ago -- it got a little interest but zero answers.