Вопрос

I have a problem with code formatting in Intellij Idea 12.1.6. My issue regards breaking lines like that:

<div class="underline">R</div>eject

The above line after applying code formatting is formated like that:

<div class="underline">R</div>
eject

I have looked through Idea's code style settings but have not found any relevant setting.

Have anyone has any idea which setting is responsible for such formatting?

Это было полезно?

Решение

I tested that the following changes the behavior as per your requirements:

(The numbers in the following steps map to the numbers in the screenshot)

  1. Go into Intellij IDEA Settings -> Code Style (1) -> HTML (2) -> Other (3)
  2. Then, under Don't break if inline content add 'div' by clicking on (4) and then (5).

After that attempting to format your code snippet does not push down extent into the next line.

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top