Use SPACE as delimiter when joining multiple lines.

Currently, when users use ctrl+mouse to select and copy multiple lines,
those lines are joined into single line in a seamless way.  LINEBREAK is
simply removed, thus the first character of second line will be
positioned right after the last character of the first line.  This patch
replaces the LINEBREAK with a SPACE.

Thanks to Jekyll Wu (adaptee@gmail.com) for patch and research.
BUG: 136730
FIXED-IN: 4.8
This commit is contained in:
Kurt Hindenburg
2011-07-24 16:22:17 -04:00
parent dff2c80177
commit 4f8da80fec

View File

@@ -1291,9 +1291,12 @@ int Screen::copyLineToStream(int line ,
const bool omitLineBreak = (currentLineProperties & LINE_WRAPPED) ||
!preserveLineBreaks;
if ( !omitLineBreak && appendNewLine && (count+1 < MAX_CHARS) )
if ( appendNewLine && (count+1 < MAX_CHARS) )
{
characterBuffer[count] = Character('\n');
// When users ask to omit the linebreaks, they usually mean: `treat
// LINEBREAK as SPACE , thus joining multiple lines into single line in
// the same way as 'J' does in VIM.`
characterBuffer[count] = omitLineBreak ? Character(' ') : Character('\n');
count++;
}