Skip to content

Commit

Permalink
Fix issue with loop printing in script console. Refs #5263
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Aug 29, 2012
1 parent a6c38d8 commit 0726289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/MantidPlot/src/CommandLineInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ void CommandLineInterpreter::showContextMenu(const QPoint & clickPoint)
*/
void CommandLineInterpreter::displayOutput(const QString & messages)
{
if(!text().endsWith("\n")) append("\n");
if(messages != "\n") append(messages);
append(messages);
}

/**
Expand All @@ -356,7 +355,6 @@ void CommandLineInterpreter::displayOutput(const QString & messages)
*/
void CommandLineInterpreter::displayError(const QString & messages)
{
if(!text().endsWith("\n")) append("\n");
append(messages);
}

Expand All @@ -366,7 +364,7 @@ void CommandLineInterpreter::displayError(const QString & messages)
void CommandLineInterpreter::insertInputPrompt()
{
const int prevPromptLineIndex = m_currentPromptLineIndex;
append("\n");
if(!text().endsWith("\n")) append("\n"); // If the text is already on a new line don't bother with another
moveCursorToStartOfLastLine();
m_currentPromptLineIndex = indexOfLastLine();
// Order is important. Qscintilla tries to make the markers
Expand Down Expand Up @@ -718,6 +716,8 @@ void CommandLineInterpreter::tryExecute()
}
else
{
// Move cursor to start of fresh line to guarantee output is on fresh line
append("\n");
execute();
}
}
Expand Down

0 comments on commit 0726289

Please sign in to comment.