smarty 'code style' settings for }else{ how to set the indent level?

when i am writing in .php files and do a code reformat it reformats like this:

if($something){
     print 'yes';
}else{
     print 'no';
}

The }else{ statement is inline with the if.  As it should be in my opinion.

But in smarty template files it gets reformatted like this:

{if $something}
     yes
     {else}
     no
{/if}

With the {else} inline with the internals.  Im wanting to format it:

{if $something}
     yes
{else}     
     no
}

Just like php would do it.  how can i get this setup?

5 comments
Comment actions Permalink

I think it's just a formatting bug, please submit a ticket at http://youtrack.jetbrains.com

0
Comment actions Permalink

While the referenced ticket seems to be saying it's fixed, it's still happening in my IntelliJ 2020.1.1. Found this issue because I'm looking for Smarty formatting help.

0
Comment actions Permalink

Timothy Binder, it doesn't seem to be reproducible, as you can see, if and else stay aligned: https://recordit.co/IxYLscfycm

0
Comment actions Permalink

Eugene Morozov. I left a comment on the ticket saying the problem was with our template code and not the IDE. I missed posting that update here. Sorry about that. Thanks for following up.

0

Please sign in to leave a comment.