[Konsole-devel] [Bug 188528] konsole's history adds spaces to end of lines when copying text

tomasb at kapsa.cz tomasb at kapsa.cz
Fri Nov 25 23:43:36 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=188528





--- Comment #107 from  <tomasb kapsa cz>  2011-11-25 23:43:36 ---
About _includeTrailingWhitespace: Screen::selectedText creates
PlainTextDecoder (_includeTrailingWhitespace is true by default). It calls
Screen::writeSelectionToStream that calls Screen::writeToStream which a)
calls copyLineToStream which calls decoder->decodeLine (history buffer?)  
and b) finally calls decoder->decodeLine.

So the following should make my proposition to comment-out
if(!_includeTrailingWhitespace) unneeded. What do you think?

diff --git a/src/Screen.cpp b/src/Screen.cpp
index 1ec2f03..69ee7ea 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -1150,6 +1204,7 @@ QString Screen::selectedText(bool
preserveLineBreaks) const
     QTextStream stream(&result, QIODevice::ReadWrite);

     PlainTextDecoder decoder;
+    decoder.setTrailingWhitespace(false);
     decoder.begin(&stream);
     writeSelectionToStream(&decoder , preserveLineBreaks);
     decoder.end();

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the konsole-devel mailing list