aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/print.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc
index 87db004b2..6eb321c43 100644
--- a/src/libexpr/print.cc
+++ b/src/libexpr/print.cc
@@ -264,10 +264,15 @@ private:
return true;
}
+ if (options.force) {
+ // The item is going to be forced during printing anyway, but we need its type now.
+ state.forceValue(*item, item->determinePos(noPos));
+ }
+
// Pretty-print single-item attrsets only if they contain nested
// structures.
auto itemType = item->type();
- return itemType == nList || itemType == nAttrs || itemType == nThunk;
+ return itemType == nList || itemType == nAttrs;
}
void printAttrs(Value & v, size_t depth)
@@ -335,10 +340,15 @@ private:
return true;
}
+ if (options.force) {
+ // The item is going to be forced during printing anyway, but we need its type now.
+ state.forceValue(*item, item->determinePos(noPos));
+ }
+
// Pretty-print single-item lists only if they contain nested
// structures.
auto itemType = item->type();
- return itemType == nList || itemType == nAttrs || itemType == nThunk;
+ return itemType == nList || itemType == nAttrs;
}
void printList(Value & v, size_t depth)