I'm using IntelliJ IDEA Ultimate 2019.
Thanks to this question, I was able to put the binary operator on the next line when code reformatting breaks lines. However, I do not find how to prevent the comma from braking like this:
String someWords = "sentence";
int someName = 1;
String m = String.format("A very long long long %s with information but too long for %s line.", someWords
, someName);
Expected behavior:
String someWords = "sentence";
int someName = 1;
String m = String.format("A very long long long %s with information but too long for %s line.",
someWords, someName);
If I change the variable name someWords
by someWord
(shorter by 1 character) then it seems to work as expected... Is it a wrapping bug or did I miss something in the CodeStyle settings?
Edit: to make the example work, 3 indents of size 4 are needed, with max length at 120.
public class Test {
public static void test() {
if (true) {
String someWords = "sentence";
int someName = 1;
String m = String.format("A very long long long %s with information but too long for %s line.", someWords
, someName);
}
}
}