mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-31 15:36:47 +02:00
prettyPrint
-> shouldPrettyPrint
This commit is contained in:
parent
a27651908f
commit
1c5f5d4291
2 changed files with 5 additions and 5 deletions
|
@ -71,7 +71,7 @@ struct PrintOptions
|
||||||
/**
|
/**
|
||||||
* True if pretty-printing is enabled.
|
* True if pretty-printing is enabled.
|
||||||
*/
|
*/
|
||||||
inline bool prettyPrint()
|
inline bool shouldPrettyPrint()
|
||||||
{
|
{
|
||||||
return prettyIndent > 0;
|
return prettyIndent > 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,14 +168,14 @@ private:
|
||||||
|
|
||||||
void increaseIndent()
|
void increaseIndent()
|
||||||
{
|
{
|
||||||
if (options.prettyPrint()) {
|
if (options.shouldPrettyPrint()) {
|
||||||
indent.append(options.prettyIndent, ' ');
|
indent.append(options.prettyIndent, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void decreaseIndent()
|
void decreaseIndent()
|
||||||
{
|
{
|
||||||
if (options.prettyPrint()) {
|
if (options.shouldPrettyPrint()) {
|
||||||
assert(indent.size() >= options.prettyIndent);
|
assert(indent.size() >= options.prettyIndent);
|
||||||
indent.resize(indent.size() - options.prettyIndent);
|
indent.resize(indent.size() - options.prettyIndent);
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ private:
|
||||||
|
|
||||||
bool shouldPrettyPrintAttrs(AttrVec & v)
|
bool shouldPrettyPrintAttrs(AttrVec & v)
|
||||||
{
|
{
|
||||||
if (!options.prettyPrint() || v.empty()) {
|
if (!options.shouldPrettyPrint() || v.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ private:
|
||||||
|
|
||||||
bool shouldPrettyPrintList(std::span<Value * const> list)
|
bool shouldPrettyPrintList(std::span<Value * const> list)
|
||||||
{
|
{
|
||||||
if (!options.prettyPrint() || list.empty()) {
|
if (!options.shouldPrettyPrint() || list.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue