mIRC Homepage

color-copy line bug

Posted By: Talon

color-copy line bug - 20/07/21 04:34 AM

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.
Posted By: Raccoon

Re: color-copy line bug - 20/07/21 02:03 PM

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.
© 2021 mIRC Discussion Forums