New here, so I hope this is actually a bug and not already been reported (I did a quick search for "newline" but found nothing relevant).
Anyway, essentially the problem is that when I receive two newlines in a two, the second newline is stripped. I haven't tested if it continues for three or more newlines in a row, but I'm assuming the same will happen.
I've located the code causing the problem, and put in my own temporary hack-fix, as C++ is largely unfamiliar for me to implement/suggest a proper fix.
For reference, the problem is in:
void TBuffer::translateToPlainText( std::string & s ) in TBuffer.cpp. Around about line 1000 in this file, there's an if block in the routine:
Code: Select all
if( ch == '\n' )
{
int line = lineBuffer.size()-1;
mpHost->mpConsole->runTriggers( line );
newLines += 1+wrap( line );
std::deque<TChar> newLine;
buffer.push_back( newLine );
lineBuffer << nothing;
QString time = "-----";
timeBuffer << time;
firstChar = true;
msPos++;
continue;
}
Declare "char prevCh" near the top of the routine, before the loop. Change the code around the problem if-block to look like:
Code: Select all
prevCh = '\0';
if (msPos > 0) {
prevCh = s[msPos-1];
}
if( ch == '\n' && prevCh != '\n')
{
int line = lineBuffer.size()-1;
mpHost->mpConsole->runTriggers( line );
newLines += 1+wrap( line );
std::deque<TChar> newLine;
buffer.push_back( newLine );
lineBuffer << nothing;
QString time = "-----";
timeBuffer << time;
firstChar = true;
msPos++;
continue;
}