Fixed output of stdout to macro IDE log

No additional newlines are inserted on flush -
this enhances compatibility with unit test framework.
This commit is contained in:
Matthias Koefferlein 2017-10-28 21:13:46 +02:00
parent d90593df89
commit cb29a2d790
1 changed files with 4 additions and 7 deletions

View File

@ -1433,10 +1433,7 @@ MacroEditorDialog::eventFilter (QObject *obj, QEvent *event)
void
MacroEditorDialog::flush ()
{
if (! m_new_line) {
// insert a new line if the stream changes ..
write_str ("\n", m_os);
}
// .. no specific implementation required for flush() ..
}
bool
@ -1481,9 +1478,9 @@ MacroEditorDialog::write_str (const char *text, output_stream os)
mp_console_text->setTextCursor (c);
}
if (m_os != OS_none && os != m_os) {
// flush if the stream changes ..
flush ();
if (m_os != OS_none && os != m_os && ! m_new_line) {
// insert a new line if the stream changes ..
write_str ("\n", m_os);
}
if (m_os != os) {