Fix formatting for multiline binary expressions

#KT-4797 Fixed
This commit is contained in:
Nikolay Krasko
2014-04-20 01:27:11 +04:00
parent 055859888e
commit 45013ce8af
31 changed files with 354 additions and 29 deletions
@@ -0,0 +1,15 @@
fun test() {
val somelong = 1 + 2 +
3 - 4 -
5 * 6 *
7 / 8 /
9 % 10 %
11
val withBrackets = 3 +
4 - (5 +
4 * 5)
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// Strage behaviour for disabled alignment is same to Java
@@ -0,0 +1,15 @@
fun test() {
val somelong = 1 + 2 +
3 - 4 -
5 * 6 *
7 / 8 /
9 % 10 %
11
val withBrackets = 3 +
4 - (5 +
4 * 5)
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// Strage behaviour for disabled alignment is same to Java
@@ -0,0 +1,15 @@
fun test() {
val somelong = 1 + 2 +
3 - 4 -
5 * 6 *
7 / 8 /
9 % 10 %
11
val withBrackets = 3 +
4 - (5 +
4 * 5)
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// Strage behaviour for disabled alignment is same to Java
@@ -0,0 +1,32 @@
fun test() {
if (true
|| false
|| true) {
}
if (true || false
|| true) {
}
if (true
|| false
|| true) {
}
if (true ||
false ||
true) {
}
true
|| true
false
&& false
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
@@ -0,0 +1,32 @@
fun test() {
if (true
|| false
|| true) {
}
if (true || false
|| true) {
}
if (true
|| false
|| true) {
}
if (true ||
false ||
true) {
}
true
|| true
false
&& false
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
@@ -0,0 +1,32 @@
fun test() {
if (true
|| false
|| true) {
}
if (true || false
|| true) {
}
if (true
|| false
|| true) {
}
if (true ||
false ||
true) {
}
true
|| true
false
&& false
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION