[Konsole-devel] [Bug 90201] copy / paste removes whitespace if it is the last character of wrapping line

shlomif at iglu.org.il shlomif at iglu.org.il
Thu Oct 9 21:34:08 UTC 2008


http://bugs.kde.org/show_bug.cgi?id=90201


shlomif iglu org il changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shlomif at iglu.org.il




--- Comment #9 from shlomif iglu org il  2008-10-09 23:34:04 ---
Hi!

I can reproduce this bug here (Mandriva Linux Cooker on a Pentium 4).

(In reply to comment #8)
> At Robert's request, I did some digging.  Here's what I found:
> 
> I took a look at this.  After looking at the code in
> Konsole::Screen::copyLineToStream(), I checked whether the 
> behavior was different when copying from the history vs. the current screen 
> image, and it is -- so the culprit seems to be this code, which is run only if 
> copying from the current screen image.
> 
>             // ignore trailing white space at the end of the line
>             for (int i = length-1; i >= 0; i--)
>                 if (data[i].character == ' ')
>                     length--;
>                 else
>                     break;
> 
> 
> I'm not entirely sure what to do -- the only thing I can think of is to change 
> it so that a single space character is allowed.  i.e. (with appropriate checks 
> for valid array values)
> 
> if (data[i].character == ' ' && data[i-1].character == ' ')
>         length--;
> 
> What do you think?  Alternately, the code could be removed entirely or changed 
> to whatever happens when it goes into the history buffer -- when copying from 
> the history, it says:  
> 
>             // retrieve line from history buffer.  It is assumed
>             // that the history buffer does not store trailing white space
>             // at the end of the line, so it does not need to be trimmed here
> 
> Obviously this isn't true as doing my copy from the history buffer does 
> properly keep the spaces in...
> 

I suggest removing it entirely. It's annoying and buggy and a
Do-what-I-don't-meannery.

Regards,

-- Shlomi Fish


-- 
Configure bugmail: http://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