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

Merge branch 'master' into caveman-LOCs

This commit is contained in:
Ben Burdette 2020-06-18 13:07:53 -06:00
commit e6f93b94fc
124 changed files with 1435 additions and 1315 deletions

View file

@ -132,7 +132,7 @@ void printCodeLines(std::ostream &out, const string &prefix, const NixCode &nixC
{
// previous line of code.
if (nixCode.prevLineOfCode.has_value()) {
out << std::endl
out << std::endl
<< fmt("%1% %|2$5d|| %3%",
prefix,
(nixCode.errPos.line - 1),
@ -176,7 +176,7 @@ void printCodeLines(std::ostream &out, const string &prefix, const NixCode &nixC
std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
{
int errwidth = 80;
auto errwidth = std::max<size_t>(getWindowSize().second, 20);
string prefix = "";
string levelString;
@ -229,12 +229,10 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
}
}
int ndl = prefix.length() + levelString.length() + 3 + einfo.name.length() + einfo.programName.value_or("").length();
int dashwidth = ndl > (errwidth - 3) ? 3 : errwidth - ndl;
auto ndl = prefix.length() + levelString.length() + 3 + einfo.name.length() + einfo.programName.value_or("").length();
auto dashwidth = ndl > (errwidth - 3) ? 3 : errwidth - ndl;
string dashes;
for (int i = 0; i < dashwidth; ++i)
dashes.append("-");
std::string dashes(dashwidth, '-');
// divider.
if (einfo.name != "")