mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
printAttrs: Force item before determining whether to print multi-line
This commit is contained in:
parent
ece334b532
commit
a0635a80b2
2 changed files with 7 additions and 3 deletions
|
@ -299,6 +299,9 @@ private:
|
||||||
output << ANSI_NORMAL;
|
output << ANSI_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @note This may force items.
|
||||||
|
*/
|
||||||
bool shouldPrettyPrintAttrs(AttrVec & v)
|
bool shouldPrettyPrintAttrs(AttrVec & v)
|
||||||
{
|
{
|
||||||
if (!options.shouldPrettyPrint() || v.empty()) {
|
if (!options.shouldPrettyPrint() || v.empty()) {
|
||||||
|
@ -315,6 +318,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 attrsets only if they contain nested
|
// Pretty-print single-item attrsets only if they contain nested
|
||||||
// structures.
|
// structures.
|
||||||
auto itemType = item->type();
|
auto itemType = item->type();
|
||||||
|
|
|
@ -2,9 +2,7 @@ Nix <nix version>
|
||||||
Type :? for help.
|
Type :? for help.
|
||||||
Added <number omitted> variables.
|
Added <number omitted> variables.
|
||||||
|
|
||||||
{
|
{ homepage = "https://example.com"; }
|
||||||
homepage = "https://example.com";
|
|
||||||
}
|
|
||||||
|
|
||||||
{ homepage = "https://example.com"; }
|
{ homepage = "https://example.com"; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue