Fix double array indentation inside parens
This commit is contained in:
parent
e79ba9f0c8
commit
e0549070a1
|
@ -629,6 +629,10 @@ private:
|
||||||
}
|
}
|
||||||
else if (arrayInitializerStart && isMultilineAt(index - 1))
|
else if (arrayInitializerStart && isMultilineAt(index - 1))
|
||||||
{
|
{
|
||||||
|
if (peekBack2Is(tok!"(")) {
|
||||||
|
indents.pop();
|
||||||
|
}
|
||||||
|
|
||||||
// Use the close bracket as the indent token to distinguish
|
// Use the close bracket as the indent token to distinguish
|
||||||
// the array initialiazer from an array index in the newline
|
// the array initialiazer from an array index in the newline
|
||||||
// handling code
|
// handling code
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
unittest
|
unittest
|
||||||
{
|
{
|
||||||
foo([
|
foo([
|
||||||
target.value.region[1], target.value.region[1],
|
target.value.region[1], target.value.region[1], target.value.region[1],
|
||||||
target.value.region[1], target.value.region[1], target.value.region[1]
|
target.value.region[1], target.value.region[1]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
unittest
|
unittest
|
||||||
{
|
{
|
||||||
Bson base = Bson([
|
Bson base = Bson([
|
||||||
"maps": Bson([
|
"maps": Bson([
|
||||||
Bson(["id": Bson(4), "comment": Bson("hello")]),
|
Bson(["id": Bson(4), "comment": Bson("hello")]),
|
||||||
Bson(["id": Bson(49), "comment": Bson(null)])
|
Bson(["id": Bson(49), "comment": Bson(null)])
|
||||||
]),
|
]),
|
||||||
"short": Bson(["a": "b", "c": "d"]),
|
"short": Bson(["a": "b", "c": "d"]),
|
||||||
"numbers": Bson([
|
"numbers": Bson([
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
3, 4, 5, 6, 7, 8, 9, 0
|
||||||
]),
|
]),
|
||||||
"shuffleOnReset": serializeToBson([
|
"shuffleOnReset": serializeToBson([
|
||||||
"all": false,
|
"all": false,
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"maybe": false
|
"maybe": false
|
||||||
]),
|
]),
|
||||||
"resetOnEmpty": Bson(false),
|
"resetOnEmpty": Bson(false),
|
||||||
"applyMods": Bson(true),
|
"applyMods": Bson(true),
|
||||||
"sendComments": Bson(true)
|
"sendComments": Bson(true)
|
||||||
]);
|
]);
|
||||||
int[] x = [
|
int[] x = [
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
|
||||||
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
auto find()
|
auto find()
|
||||||
{
|
{
|
||||||
return Map.findRange([
|
return Map.findRange([
|
||||||
"$and": [
|
"$and": [
|
||||||
["deleted": Bson(false)],
|
["deleted": Bson(false)],
|
||||||
[
|
[
|
||||||
"$or": Bson([
|
"$or": Bson([
|
||||||
serializeToBson(["forceUpdate": Bson(true)]),
|
serializeToBson(["forceUpdate": Bson(true)]),
|
||||||
serializeToBson([
|
serializeToBson([
|
||||||
"info.approved": ["$eq": Bson(1)],
|
"info.approved": ["$eq": Bson(1)],
|
||||||
"fetchDate": [
|
"fetchDate": [
|
||||||
"$lte": Bson(BsonDate(currentTime - 60.days))
|
"$lte": Bson(BsonDate(currentTime - 60.days))
|
||||||
]
|
]
|
||||||
]),
|
]),
|
||||||
serializeToBson([
|
serializeToBson([
|
||||||
"info.approved": ["$ne": Bson(1)],
|
"info.approved": ["$ne": Bson(1)],
|
||||||
"fetchDate": [
|
"fetchDate": [
|
||||||
"$lte": Bson(BsonDate(currentTime - 14.days))
|
"$lte": Bson(BsonDate(currentTime - 14.days))
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]
|
|
||||||
]
|
]
|
||||||
]);
|
]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
unittest {
|
unittest {
|
||||||
foo([
|
foo([
|
||||||
target.value.region[1], target.value.region[1],
|
target.value.region[1], target.value.region[1], target.value.region[1],
|
||||||
target.value.region[1], target.value.region[1], target.value.region[1]
|
target.value.region[1], target.value.region[1]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
unittest {
|
unittest {
|
||||||
Bson base = Bson([
|
Bson base = Bson([
|
||||||
"maps": Bson([
|
"maps": Bson([
|
||||||
Bson(["id": Bson(4), "comment": Bson("hello")]),
|
Bson(["id": Bson(4), "comment": Bson("hello")]),
|
||||||
Bson(["id": Bson(49), "comment": Bson(null)])
|
Bson(["id": Bson(49), "comment": Bson(null)])
|
||||||
]),
|
]),
|
||||||
"short": Bson(["a": "b", "c": "d"]),
|
"short": Bson(["a": "b", "c": "d"]),
|
||||||
"numbers": Bson([
|
"numbers": Bson([
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
3, 4, 5, 6, 7, 8, 9, 0
|
||||||
]),
|
]),
|
||||||
"shuffleOnReset": serializeToBson([
|
"shuffleOnReset": serializeToBson([
|
||||||
"all": false,
|
"all": false,
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"maybe": false
|
"maybe": false
|
||||||
]),
|
]),
|
||||||
"resetOnEmpty": Bson(false),
|
"resetOnEmpty": Bson(false),
|
||||||
"applyMods": Bson(true),
|
"applyMods": Bson(true),
|
||||||
"sendComments": Bson(true)
|
"sendComments": Bson(true)
|
||||||
]);
|
]);
|
||||||
int[] x = [
|
int[] x = [
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
|
||||||
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
auto find() {
|
auto find() {
|
||||||
return Map.findRange([
|
return Map.findRange([
|
||||||
"$and": [
|
"$and": [
|
||||||
["deleted": Bson(false)],
|
["deleted": Bson(false)],
|
||||||
[
|
[
|
||||||
"$or": Bson([
|
"$or": Bson([
|
||||||
serializeToBson(["forceUpdate": Bson(true)]),
|
serializeToBson(["forceUpdate": Bson(true)]),
|
||||||
serializeToBson([
|
serializeToBson([
|
||||||
"info.approved": ["$eq": Bson(1)],
|
"info.approved": ["$eq": Bson(1)],
|
||||||
"fetchDate": [
|
"fetchDate": [
|
||||||
"$lte": Bson(BsonDate(currentTime - 60.days))
|
"$lte": Bson(BsonDate(currentTime - 60.days))
|
||||||
]
|
]
|
||||||
]),
|
]),
|
||||||
serializeToBson([
|
serializeToBson([
|
||||||
"info.approved": ["$ne": Bson(1)],
|
"info.approved": ["$ne": Bson(1)],
|
||||||
"fetchDate": [
|
"fetchDate": [
|
||||||
"$lte": Bson(BsonDate(currentTime - 14.days))
|
"$lte": Bson(BsonDate(currentTime - 14.days))
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]
|
|
||||||
]
|
]
|
||||||
]);
|
]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue