Open thisirs opened 8 years ago
Hi, this is standard Emacs behaviour within strings.
Note that if it was indented you would have spaces inside your string which in many case is not what's expected. So strings should not be indented except with languages featuring string dedentation like Julia.
I don't want my string to be indented. I want broken
to be indented just like first
and the string!
ah yes, the rule is to never indent past leftmost indentation.
What's even more odd is that we have:
blah(first,
"continued
string",
broken)
So the indentation of broken
depends on what the string contains...
yes that's because of the rule I mentioned, otherwise we'd have ugly hanging indents in those cases:
lapply(x, function(y) {
NULL
},
arg)
@lionel- , but aren't we supposed to treat strings as a literals and indent with respect to the beginnings of those instead of the most recent lines?
I'm not sure I get what you're saying @vspinu
I am saying that
blah(first,
"continued
string",
broken)
should be indented as
blah(first,
"continued
string",
broken)
That is broken
should be indented with respect to the beginning of the whole string"continued
and not aligned to string"
.
ok I thought you were suggesting something else than OP. I think it makes sense it's just that it's very low priority stuff. Would you like to send a PR @thisirs ?
@lionel- I can give it a try. Some pointers are welcome !
The relevant function is ess-maximum-args-indent
in ess-r-d.el. It currently checks all arguments but it really should only check the last one (but that can stay like this for now).
Run make indent-cases
in the test folder and check if any of the test file has changed (i.e. has broken).
Hi all,
I have the following behaviour with latest melpa ESS with a discontinued indentation with continued strings ;)
Is there an option controlling this or is it a bug?