Skip to content

Commit

Permalink
Fix for #1221: apply multi-lines indent to "if/for/while (...)"
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Feb 2, 2021
1 parent 1ec3d8d commit f91b541
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 88 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
###prop
setPreferences=true
bracesEnd=next
indentation=space
tabsize=4
indentEmptyLines=true
indentation=space
setPreferences=true
###src
MyBean soSomething() {
return new MyBean('foo',
T f() {
return new T('foo',
'bar', 'baz')
}
MyBean soSomething() {
return method('foo',
T g() {
return m('foo',
'bar', 'baz')
}
###exp
MyBean soSomething() {
return new MyBean('foo',
T f() {
return new T('foo',
'bar', 'baz')
}
MyBean soSomething() {
return method('foo',
T g() {
return m('foo',
'bar', 'baz')
}
###end
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
###prop
setPreferences=true
indentation=space
tabsize=4
indentation=space
indentendOnly=true
setPreferences=true
###src
if(true)
println "true"
else
println "false"

if(true) {
println "true"
} else {
Expand All @@ -21,6 +22,12 @@ println "true true"
} else if (false)
println "true false"

if(true)
print 'true'
else
if (false)
print 'false'

if (true)
if (true)
print "XXX"
Expand All @@ -33,6 +40,7 @@ if(true)
println "true"
else
println "false"

if(true) {
println "true"
} else {
Expand All @@ -46,6 +54,12 @@ if(true) {
} else if (false)
println "true false"

if(true)
print 'true'
else
if (false)
print 'false'

if (true)
if (true)
print "XXX"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
###prop
setPreferences=true
indentation=space
tabsize=4
indentation=space
indentendOnly=true
setPreferences=true
###src
if(true)
println "true"
Expand All @@ -13,6 +13,11 @@ if (true)
{
print "true"
}
if( true
&& true
&& false) {
print('test')
}
###exp
if(true)
println "true"
Expand All @@ -23,4 +28,9 @@ if (true)
{
print "true"
}
if( true
&& true
&& false) {
print('test')
}
###end
Loading

0 comments on commit f91b541

Please sign in to comment.