[ESS] indentation not working if parentheses are already closed

Ista Zahn istazahn at gmail.com
Tue Apr 16 17:12:47 CEST 2013


On Tue, Apr 16, 2013 at 11:02 AM, Jannis <bt_jannis at yahoo.de> wrote:
> Hi Ista,
>
>
> thanks for your reply!
>
>
> On 16.04.2013 14:58, Ista Zahn wrote:
>
>> pressing enter does start an indented line, but completing the
>> function shows that the closing bracket is not indented, i.e.,
>> pressing enter and inserting the closing brace results in:
>>
>> foo <- function() {
>> }
>>
>>
>> In the second case you insert the closing bracket and press enter,
>> which gives you the same thing. If you start typing the body of the
>> function and press tab it will indent correctly, i.e., if I type
>> 'print("bar")<TAB> I end up with
>>
>> foo <- function() {
>>    print("bar")}
>>
>
> You are right. When I press <TAB>, the indentation is correct. I was looking
> for a way to have the automatic indendation without pressing <TAB> right
> after pressing <RETURN> as it is the case when the prantheses are not yet
> closed. I.e. if i first type:
>
> foo <- function() {<cursor>}
>
> hiting return would yield:
>
> foo <- function() {
>      <cursor>}
>
> instead of
>
> foo <- function() {
> <cursor>}
>
> Any ideas?

Did you look for promising options in 'ess-default-style' and
'ess-own-style-list'? Note that I've not played around with these, but
this looks like the preferences that control indentation, and it looks
pretty flexible. I'd be surprised if there is not some combination of
settings that produces the desired behavior (or something close too
it).

Best,
Ista
>
>
> Cheers
> Jannis
>
>



More information about the ESS-help mailing list