1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 13:41:15 +02:00

Don't print values in magenta

This fixes the opening bracket of lists/attrsets being printed in
magenta, unlike the closing bracket.

https://github.com/NixOS/nix/pull/9753#issuecomment-1904616088
This commit is contained in:
Rebecca Turner 2024-02-03 19:21:20 -08:00
parent 49cf090cb2
commit 9646d62b0c
No known key found for this signature in database
3 changed files with 131 additions and 114 deletions

View file

@ -511,4 +511,11 @@ std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer)
return output;
}
template<>
hintformat & hintformat::operator%(const ValuePrinter & value)
{
fmt % value;
return *this;
}
}

View file

@ -9,6 +9,7 @@
#include <iostream>
#include "fmt.hh"
#include "print-options.hh"
namespace nix {
@ -78,4 +79,13 @@ public:
};
std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer);
/**
* `ValuePrinter` does its own ANSI formatting, so we don't color it
* magenta.
*/
template<>
hintformat & hintformat::operator%(const ValuePrinter & value);
}