summaryrefslogtreecommitdiffstats
path: root/src/line_printer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/line_printer.cc')
-rw-r--r--src/line_printer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/line_printer.cc b/src/line_printer.cc
index 54f0a5b..bfa737e 100644
--- a/src/line_printer.cc
+++ b/src/line_printer.cc
@@ -96,3 +96,10 @@ void LinePrinter::Print(std::string to_print, LineType type) {
printf("%s\n", to_print.c_str());
}
}
+
+void LinePrinter::PrintOnNewLine(const string& to_print) {
+ if (!have_blank_line_)
+ printf("\n");
+ printf("%s", to_print.c_str());
+ have_blank_line_ = to_print.empty() || *to_print.rbegin() == '\n';
+}