mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
no blank line if no LOC
This commit is contained in:
parent
960d4362ed
commit
ecbb8e9c0a
3 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "logging.hh"
|
||||
#include "nixexpr.hh"
|
||||
#include "util.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
|
|
|
@ -182,7 +182,7 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
|
|||
}
|
||||
|
||||
// lines of code.
|
||||
if (einfo.nixCode.has_value()) {
|
||||
if (einfo.nixCode.has_value() && einfo.nixCode->errLineOfCode.has_value()) {
|
||||
printCodeLines(out, prefix, *einfo.nixCode);
|
||||
out << prefix << std::endl;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue