Intellij automatic wrap && or || in new lines
Answered
I have activated automatic wrapping so if a line gets over 120 characters it will get moved to the next line. Example:
if (!(railVehiclesInListForm.get(i).getBackCoupling() &&
railVehiclesInListForm.get(i + 1).getFrontCoupling()))
This is how it is being wrapped at the moment. But I would like to wrap it with the "&&" in the next line because I think it is nicer to look at and my Checkstyle requires this. Like this:
if (!(railVehiclesInListForm.get(i).getBackCoupling()
&& railVehiclesInListForm.get(i + 1).getFrontCoupling()))
Please sign in to leave a comment.
To apply such statements formatting, you can open the settings (Preferences | Editor | Code style | Java) and mark the following fields in section "Binary expressions ": https://prnt.sc/r3eoa7
Make sure that "Wrap on typing" checkbox is enabled: https://prnt.sc/r3er92