mIRC Home    About    Download    Register    News    Help

Print Thread
Alt+D alias list jump glitch #268466 19/02/21 06:50 PM
Joined: Jan 2004
Posts: 1,619
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,619
Item#3 in:
https://forums.mirc.com/ubbthreads.php/topics/268464/some-things

I agree that the dropdown list of aliases for the remotes tab would also be great.

While the intended behavior is that clicking on an alias name in the menu jumps to that line in the file, there are a few cases where a mis-jump happens, and it continues to happen for all aliases further down in the file.

It appears that the aliases are indexed for the dropdown list by harvesting aliases beginning with a-z, but when an alias doesn't follow the expected structure, it instead jumps to an alias sequentially beneath it, with no respect to alphabetical order.

There may be other cases which causes the dropdown menu to jump to the wrong alias. These cases listed here are based on things from my own aliases files. Other forum members can test their aliases file(s) to see if they have the glitch by scrolling to the bottom of the file until you find the next-to-last alias. If you choose that alias from the dropdown and it doesn't jump the cursor to that location, then you have an alias higher up which causes the glitch. The fastest way to find the problem alias is to play the high-low game. Scroll back to the middle of the alias file, find an alias there and try to jump to it. If you are able to jump to that alias from the dropdown, then there's at least 1 glitched alias below it beneath it. Some glitches you can solve by removing the optional leading slash as described below.

Here are some examples of alias names which cause a dis-connect between the alias's actual location and the line number that gets jumped to when you click on there in the dropdown. These aliases do not appear on the dropdown list, and they alter the jump location when clicking on all alias names physically present at a line number beneath these glitched alias names:

(1) Alias begins with number or non-alpha. While syntax doesn't let you call $888 because of interpreting that as something following the $8 parm, it is valid to call /888 as a command:

Code
/4chan {
  echo -a 4chan_alias $scriptline
}


(1b) Also aliases beginning with other non-alpha characters

Code
/&binvar {
  echo -a This is the &binvar alias $scriptline
}


(1c) Alias begins with codepoint above 127

Code
écho {
  echo -a écho test $scriptline
}
Écho {
  echo -a écho test $scriptline
}


Note: The alias names 4chan and &binvar do not glitch the jump if they are NOT preceded by the slash, so you can eliminate the glitch by removing the optional forward slash. However, the alias beginning with codepoint above 127 glitches regardless whether the slash is present. Codepoints 201 and 233 are not recognized as an upper/lower pair, so these are 2 separate aliases

(2) While the Alt+D window permits aliases to have an optional leading forward-slash, if the alias begins with 2 slashes, it triggers the glitch.

Code
//double_slash {
echo -a This double_slash alias causes a mis-jump for all aliases beneath and does not itself appear in the dropdown $scriptline
}


(2b)

Code
!!exclamation_test {
echo -a exclamation_test alias $scriptline
}


Note that preceding the alias name with 1 or 2 exclamation characters does not cause the mis-jump for the aliases beneath it, but both 1 and 2 of the exclamations does prevent that alias itself from appearing in the dropdown list

--

Since the menu joins letters f-k together, it's probably fine for all the codepoints earlier than [a-z] to be joined together.

Re: Alt+D alias list jump glitch [Re: maroon] #268478 21/02/21 02:27 PM
Joined: Dec 2002
Posts: 5,002
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,002
Thanks for your bug report. This issue has been fixed for the next version. I have also changed it so that instead of combining submenus, it lists all a-z submenus separately and adds a "?" submenu for non-a-to-z aliases.

Re: Alt+D alias list jump glitch [Re: Khaled] #268651 04/04/21 06:26 AM
Joined: Jan 2004
Posts: 1,619
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,619
The beta now having the alias index for $script files caused some changes for aliases files which may not be intentional.

(1)
The aliases.ini shows the alias grouped with the 1st letter only if it doesnt have a prefix in front of it. That means the 'foo1' alias shows in the sorted list under the letter 'f', while 'foo2' 'foo3' and 'double_slash' are sorted by their prefix within the "?" menu item, along with all the other sample aliases like /j /op etc. Formerly, foo1 and foo2 would both be listed in the f's.

Code
foo1 echo -ag test1
/foo2 echo -ag test2
!foo3 echo -ag test3
&binvar echo -ag alias &binvar is listed with the 'b' underlined
upper&lower1 echo -ag upper: $upper($1-) lower: $lower($1-)
upper&&lower2 echo -ag upper: $upper($1-) lower: $lower($1-)
//double_slash { echo -ag doubleslash }


(2)
Also, if the /* beginning a multi-line comment is located on line 1 of aliases.ini or a $script file, a phantom /* entry appears in the "?" index. But if that comment starts at line 2 it doesn't appear in the list.

(3)
Also, something that previously existed but I didn't report previously, that's due to the normal way that menu{} and dialog controls handle the & char. Both aliases containing the single & are instead shown with the following letter underlined, and the alias containing a double & shows only 1 of them without any underlining. Same thing has always happened in other places, like the way "/window @test&test" appears in the window dropdown menu. For dialogs, we sanitize the dialogcontrol's text like $replace(string,&,&&).