Cleanup
This commit is contained in:
parent
4e995bc8a6
commit
f20bb983ca
|
@ -105,7 +105,7 @@ void printCodeLines(std::ostream &out, const string &prefix, const NixCode &nixC
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
|
std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
|
||||||
{
|
{
|
||||||
int errwidth = 80;
|
size_t errwidth = 80;
|
||||||
string prefix = "";
|
string prefix = "";
|
||||||
|
|
||||||
string levelString;
|
string levelString;
|
||||||
|
@ -158,12 +158,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();
|
auto ndl = prefix.length() + levelString.length() + 3 + einfo.name.length() + einfo.programName.value_or("").length();
|
||||||
int dashwidth = ndl > (errwidth - 3) ? 3 : errwidth - ndl;
|
auto dashwidth = ndl > (errwidth - 3) ? 3 : errwidth - ndl;
|
||||||
|
|
||||||
string dashes;
|
std::string dashes(dashwidth, '-');
|
||||||
for (int i = 0; i < dashwidth; ++i)
|
|
||||||
dashes.append("-");
|
|
||||||
|
|
||||||
// divider.
|
// divider.
|
||||||
if (einfo.name != "")
|
if (einfo.name != "")
|
||||||
|
|
Loading…
Reference in a new issue