0

I can't figure out how to configure the Eclipse formatter so it formats my xhtml pages the way I want. I would like (e.g.) <h:panelGroup> on a new line.

I get:

<h:panelGroup ...>
     ...
</h:panelGroup> <h:panelGroup ...>
     ...
</h:panelGroup>

But I would like:

<h:panelGroup ...>
     ...
</h:panelGroup>
<h:panelGroup ...>
     ...
</h:panelGroup>
Stefan
  • 2,395
  • 4
  • 15
  • 32

1 Answers1

0

Have you tried this?

go to Window --> preferences --> Web --> HTML files --> Editor.

In the Inline Elements section, select all the elements that you don't want eclipse to inline(continue with same line).

Click Apply and then Ok. Now re formant using ctrl + shift + f.

Community
  • 1
  • 1
Tuan Hoang
  • 586
  • 1
  • 7
  • 14
  • Yes, I've looked there. But h:panelGroup is not in the list so I cannot remove it. – Stefan Apr 15 '19 at 05:07
  • Yes, I've tried ctrl + shift + f. That's when newline that I want is taken away from me. Do you find h:panelGroup in your Inline Elements list? – Stefan Apr 16 '19 at 05:53
  • Unfortunately, no. And when I use ctrl + shift + f, it automatically formats as your expectation. One question, can you check your Eclipse shortcut key configuration by go to Window > Preferences > Keys and check if your Eclipse configures Ctr + shift + f is binding? – Tuan Hoang Apr 16 '19 at 09:21
  • ctrl + shift + f formats the code, as expected. It is just that it does not produce the format I want. Thank you Tuan Hoang for your efforts! – Stefan Apr 16 '19 at 11:08
  • 1
    You're welcome! Sorry for not helping you solving the problem :( Last information, my Eclipse version to answer you is Photon Release (4.8.0) – Tuan Hoang Apr 16 '19 at 14:45