mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 1,949
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,949
This situation doesn't affect me, because I had changed to EditboxLines=Automatic because of it. But maybe it would help others who like =1 because it allows UpArrow to browse through history without needing Ctrl+UpArrow to get past long lines.

Suggesting that the behavior would be more useful if modified slightly for when

EditboxLines=1
$cb(0)==1
ConfirmPaste=1

... so that there is no prompt if Confirm is set at 1 line, and the paste does not contain $cr or $lf.

If so, the prompt's text could change from saying line(s) and instead say message(s).

As I understand it, a paste going automatically to channel can only happen when EditboxLines=1, so the only time the prompt ever triggers is when that specific editbox has the =1 setting.

It seems the purpose of setting the prompt for large values is when someone normally pastes a small number of lines, but needs to draw-the-line at a huge line count to avoid triggering a flood. However it seems that the purpose of setting the prompt at 1 is different, which is to prevent any paste at all without <enter>.

When using EditboxLines=1, and the Confirm prompt is set at 1+ lines, and you paste something into the editbox, the prompt pops up and shows you the 1 line of text, and there's no way from that prompt to know whether the clipboard:

holds $+(string,$crlf) that will be pasted into channel if you click <yes>
holds $remove(string,$cr,$lf) that will not until you press <enter>.

If the behavior were changed to so that text without $cr or $lf did not generate the prompt, that would allow someone to keep the confirm setting at '1', where they could still paste text-without-crlf into the editbox without triggering the false alarm confirm each time they pasted something that will not trigger a message to channel.

This would be the only proposed change, since $cb(0)==2 will generate 2 messages regardless whether the 2nd line ends with $crlf or not.

--

The most common way that I was bitten by this is in the past was because the script editor has behavior that's not typical of text editors.

In notepad and most text editors, when at the beginning of the line and pressing <DOWN>, the behavior is to include the $crlf in the highlighted text that Ctrl+C copies, but if you pressed <END> instead, then Ctrl+C in Notepad copies the line without the $crlf.

However, the script editor has the same behavior for <END> as it has for <DOWN> which clipboards the identical text including the trailing $crlf. So, when I used <END> in the editor to highlight a script line with the intent of pasting into the #channel editbox then modifying before pasting to channel, the unknown trailing $crlf caused the paste to go instantly to channel.

True, pressing <end> did advance the lower-right position indicator to column 1 of the following line, but most people wouldn't be looking there while clipboarding text.

Joined: Jan 2004
Posts: 1,949
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,949
Update:

Another effect of warning based on the count of actual outbound messages is that it can affect the other situations where $cb(0) is greater than 1. It can enable a warning in some cases which doesn't warn now, as well as avoid triggering a warning for something that doesn't generate multiple server messages.

It appears to be counting lines differently than $cb(0), by counting only $crlf and $lf but does not count lone $cr. This example generates 5 channel messages but does not trigger for warn if >= 2 lines:

//clipboard $+(text1,$cr,text2,$cr,text3,$cr,text4,$cr,text5) | echo -a $cb(0)

The warning also counts consecutive $crlf that do not generate a server message, such as pasting from a text file having blank rows. This example generates 2 server messages but triggers the warning for >= 5 lines:

//clipboard $+(text1,$crlf,$crlf,$crlf,$crlf,text2,$crlf) | echo -a $cb(0)


Link Copied to Clipboard