mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
It seems there is some type of bug with sline positioning dependent on whats been done to the window and what line might have previously been selected.

Its a bit hard to explain so I created a short chunk of code to demonstrate it.
simple type /ex1
Use the side listbox and do the following
(1) click "line 10" , mainwindow line 10 highlights and is the bottom line (expected behavour)
(2) click "line 5" , mainwindow line 5 highlights and is near the bottom line, one visual line of line 6 shown (expected behavour)
(3) click "line 2" , mainwindow line 2 highlights and is near the bottom line, one visual line of line 3 shown (expected behavour)
(4) click "line 5" , mainwindow line 5 highlights but is the bottom line (unexpected behavour)
(4) click "line 5" , mainwindow line 5 highlights but is the bottom line (unexpected behavour)

The unexpected behavour can sometimes become far worse in the full script, in that part or all of the line i want highlighted and visual sometimes is off the bottom of the window.

The remarked line(s) *1 or *2 can be used to correct the problem, however it took me a while to track the problem down and implement this patch.

* the fact im doing /RLINE seems to be important, however the reverse coloring is not, as i have tested with no /RLINE and it acts as expected (no bug) but with /RLINE even with no contents change (no ctrl-r added) the bug appears, I have therorised that it is caused by some type of internal displacement list not being updated to reflect the rline update, totally guessing realy tho.

(I have also posted this in scripts and popups but not for the same thing, im asking if anyone knows how to center the highlighted line)

Code:
alias ex1 {
  window -c @ex1
  window -el20 @ex1
  var %i = 1
  while (%i <= 10) {
    var %line, %j = 100
    while (%j) { var %line = $+(%line,$chr(3),$calc(%j % 16) %i) | dec %j }
    aline -p @ex1 Line %i ----- %line
    iline -l @ex1 1 Line %i
    inc %i
  }
}
menu @ex1 {
  lbclick : { 
    ///echo -st LBCLICK $active : $1- : $line($active,$1,1)
    sline -l $active $1
    var %num = $gettok($line($active,$1,1),2,32)
    var %rev = $chr(22)
    while ($fline($active,$+(%rev,*),1,0)) { rline $active $v1 $mid($line($active,$v1,0),2) }
    rline $active %num $+(%rev,$line($active,%num,0))
    ;*1 sline $active $line($active,0,0)
    sline $active $calc(%num + 1)
    ;*2 sline $active $calc(%num + 1)
    ;   sline $active $calc(%num + 1)
  }
}

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Indeed. I've also confirmed v6.16, not sure about formers.

It would appear it also occurs if you go from a line below the "Second selected" line. I.e, from line 2 to 4, 8 to 10, and so on (but must be a jump larger than 1 line.


-KingTomato
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
I have a feeling this is a bug due to wrapping, sline $active %num ALWAYS works with or without /rline. If you want a line up it seems mIRC seems confused between printed lines and actual terminated lines. In all cases if you click a bugged line twice it seems to correct itself smirk


$maybe
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I believe the clicking a buggered line twice correcting itself, is due to the second selecting of it not moving the selected line more than 2 selected lines distance, which KT also pointed out works (moves with in 1 line). It felt it was a bug some how connected to rline, as if i remove the rline effects, the correct sline is always displayed on the first instance.
Also one of the correcting methods i showed was to repeatedly target a line using sline (3 times seems to do it fine) This would be similar to clicking it more than once.


Link Copied to Clipboard