mIRC Home    About    Download    Register    News    Help

Print Thread
color-copy line bug #269219 20/07/21 04:34 AM
Joined: Dec 2002
Posts: 216
T
Talon Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 216
I found this bug, only testing in 7.66 on Win10. Color-copying a line tends to miss trailing control codes (at the end of a line)

for sake of readability: I will demonstrate in code rather than actual control code characters.

Steps to reproduce:

1) Execute the following:
//clear | echo -a this is a $+($chr(3),4test,$chr(3))

2) color copy the entire line (hold control while selecting the line)

3) execute the following:
//editbox -a $cb ( $len($cb) ) vs $iif($line($active,1),$v1) ( $len($v1) )

I decided to shove it in the editbox as this makes "most" control codes visible, so you can clearly see the results which show the end [k] is missing on color-copy.

pseudo-result (changed for sake of readability):
this is a [k]4test ( 16 ) vs this is a [k]4test[k] ( 17 )

The color-copied line is != to the window buffer line referenced with $line()

I only found this by accident color copying a line from one window and pasting it with some more details in another, my extra details after what I pasted wound up colored when the line itself using $line() clearly showed that the color code was in fact terminated, and the color-copy itself was the culprit. I have not tested this for other terminations for all control characters, only noticed this with colors so far, so it may exist for all possible end-of-line control code terminations.

Re: color-copy line bug [Re: Talon] #269220 20/07/21 02:03 PM
Joined: Feb 2003
Posts: 2,773
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,773
I think this has always been the issue with trailing control characters (or at least certain ones) that don't amount to anything in the copied line. It has to do with Khaled's truncated line copy code, which does its best to reformat control characters from partial copies so that they still make sense and WYSIWYG. I'm not sure if Khaled can detect when a full line is selected so that it can forego this format kungfu and smack the raw text into the clipboard. Maybe this just needs a new key combo like Ctrl+Shift + Select.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!