mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
printList: Force item before determining whether to print multi-line
This commit is contained in:
parent
a0635a80b2
commit
da3eff60bc
@ -377,6 +377,9 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @note This may force items.
|
||||
*/
|
||||
bool shouldPrettyPrintList(std::span<Value * const> list)
|
||||
{
|
||||
if (!options.shouldPrettyPrint() || list.empty()) {
|
||||
@ -393,6 +396,9 @@ private:
|
||||
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
|
||||
// structures.
|
||||
auto itemType = item->type();
|
||||
|
@ -14,9 +14,7 @@ Added <number omitted> variables.
|
||||
layerOne = { ... };
|
||||
}
|
||||
|
||||
[
|
||||
"https://example.com"
|
||||
]
|
||||
[ "https://example.com" ]
|
||||
|
||||
[ "https://example.com" ]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user