Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(intellij) format xml with tag-end part on new line

I'm using Android Studio, and layout xml indentation is auto-formatting in somewhat wrong way for me.

Instead of

<!-- case1: miss-diffs on git -->
<SomeXML
    attr1="hello" >
</SomeXML>

or

<!-- case2: wrong end(?) indentation level -->
<SomeXML
    attr1="world"
    >
</SomeXML>

I'd like to format my xml as

<SomeXML
    attr1="hello"
>
</SomeXML>

so that my git diff won't show any miss-diffs from case1, and without wrong indentation level (case2) to confuse myself.

Are there any options in intellij for this? Thanks in advance : )

like image 844
Dev Doomari Avatar asked Nov 09 '22 09:11

Dev Doomari


1 Answers

Go to File -> Settings -> Editor -> Code Style -> XML

Change the Scheme there to Default. Normally it doesn't restrict on what you are trying to do, unnless there is any defined settings.

enter image description here

like image 61
Supun Wijerathne Avatar answered Nov 15 '22 05:11

Supun Wijerathne