mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
printList: Force item before determining whether to print multi-line
This commit is contained in:
parent
a0635a80b2
commit
da3eff60bc
2 changed files with 7 additions and 3 deletions
|
@ -377,6 +377,9 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @note This may force items.
|
||||||
|
*/
|
||||||
bool shouldPrettyPrintList(std::span<Value * const> list)
|
bool shouldPrettyPrintList(std::span<Value * const> list)
|
||||||
{
|
{
|
||||||
if (!options.shouldPrettyPrint() || list.empty()) {
|
if (!options.shouldPrettyPrint() || list.empty()) {
|
||||||
|
@ -393,6 +396,9 @@ private:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is ok to force the item(s) here, because they will be printed anyway.
|
||||||
|
state.forceValue(*item, item->determinePos(noPos));
|
||||||
|
|
||||||
// Pretty-print single-item lists only if they contain nested
|
// Pretty-print single-item lists only if they contain nested
|
||||||
// structures.
|
// structures.
|
||||||
auto itemType = item->type();
|
auto itemType = item->type();
|
||||||
|
|
|
@ -14,9 +14,7 @@ Added <number omitted> variables.
|
||||||
layerOne = { ... };
|
layerOne = { ... };
|
||||||
}
|
}
|
||||||
|
|
||||||
[
|
[ "https://example.com" ]
|
||||||
"https://example.com"
|
|
||||||
]
|
|
||||||
|
|
||||||
[ "https://example.com" ]
|
[ "https://example.com" ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue