Page 2 of 16
Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 16:19
by admin
PS: One
$i = 0; was missing in your code. The second round
*always* takes 1281 msecs here, very unusual for Windows! The first round varies a bit, but is always faster. I'm really surprised.
I can confirm those results.
Code: Select all
$start = now("msecs");
while($i++ < 10000) {
if ("path_x" LikeI <curpath>) {
}
}
text 'Time <curpath>: ' . now("msecs") - $start . " msecs";
// Result = ~ 1234 msecs
$current = <curpath>;
$start = now("msecs");
$i = 0;
while($i++ < 10000) {
if ("path_x" LikeI $current) {
}
}
text 'Time $current: ' . now("msecs") - $start . " msecs";
// Result = 1281 msecs
Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 16:23
by highend
The code snippets weren't in the same script. I've run them separately and only for showing what I measured I've pasted them here together as one and you're right, in this case the $i = 0; was indeed missing.
Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 17:18
by klownboy
Don, are you sure you wanted to call the new CEA tweaks CEA_OnBrowseScript and CEA_OnBrowseScript_Script? It doesn't really fit with the terminology of the other CEAs (i.e., the word script in both). Maybe just CEA_OnBrowse and CEA_OnBrowse_Script.
Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 17:22
by admin
Yes, because contrary to the other ones these are only about scripts.
Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 17:25
by klownboy
Well OK, but it still would have been fine the other way and more consistent with the other CEAs.

Re: CAE_LocationChange, pleeeeease...
Posted: 30 Nov 2020 17:27
by admin
Well, okay, can save some bytes... next beta...

Re: CEA_LocationChange, pleeeeease...
Posted: 01 Dec 2020 01:49
by jupe
This is a game changer.

Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 07:23
by admin
I guess it's time to lift the CEA configuration to UI...
FYI, this is when it started (still as "OEA" then). I meditated for 12 years, LOL:
Code: Select all
v7.70.0007 - 2008-10-24 17:40
+ Implemented the first "On Event Action" (OEA), but for now only as
a tweak (still meditating about the interface).
[Settings]
OEA_ListRightClickOnWhite=0
The event is "right-click on the list's white space", and you can
currently choose between the following actions:
0 = Popup the Edit menu (as has been before all the time)
1 = Popup the Shell menu for the current folder
2 = Do nothing
Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 10:23
by highend
Code: Select all
$actions = <<<>>>
R:\Pictures|#308
D:\Users\%USERNAME%\Contacts|load "@test.xys";
>>>;
$actions = regexreplace($actions, "^[ \t]+");
$newpath = <newpath>;
foreach($item, $actions, <crlf>, "e") {
$path = trim(gettoken($item, 1, "|"), "\", "R");
$cmd = gettoken($item, 2, "|", "t", 2);
if ($path LikeI $newpath) {
load $cmd, , "s";
break;
}
}
// Additional scripts that should always be loaded regardless
// if <curpath> was found in $actions
load "Show git branch name in tab.xys";
With a short demo of the load script at the end and the first entry of $actions...

- GIF 01.12.2020 10-19-40.gif (314.53 KiB) Viewed 2234 times
Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 19:58
by klownboy
Concerning your raising of CEAs to the GUI, great news! I immediately tested that assigning a variable to a script (e.g.,
perm $ListDoubleClickOnWhite=WhiteSpaceDoubleClickMenu with an XYplorer.ini key value is
CEA_ListDoubleClickOnWhite_Script=load $ListDoubleClickOnWhite) thankfully still works. It's nice to be able to change the script assigned to a double click or right click and more importantly be able to change it on the fly. Simply changing the script referred to as the variable.
By the way, why call it "double click on empty", why not stick with "dbl-click on white (or white space)". I think most people will recognize that quicker than empty and it's in sync with the ini keys.
Thanks.

Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 20:42
by admin
klownboy wrote: ↑01 Dec 2020 19:58
By the way, why call it "double click on empty", why not stick with "dbl-click on white (or white space)". I think most people will recognize that quicker than empty and it's in sync with the ini keys.
If you say so, alright. I guess I was thinking of dark mode and shied away from "white"...
Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 20:43
by admin
BTW, this setting can completely go away now, right?
Configuration | General | Menus, Mouse, Usability | Mouse | Double-click on empty space goes up
Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 20:51
by highend
BTW, this setting can completely go away now, right?
I see no reason why it should be kept
Re: CEA_LocationChange, pleeeeease...
Posted: 01 Dec 2020 20:55
by admin
And instead of "Default" the first entry in the "On dbl-click on empty in folder tree/file list" combo should be "Nothing".
Re: CAE_LocationChange, pleeeeease...
Posted: 01 Dec 2020 21:21
by klownboy
admin wrote: ↑01 Dec 2020 20:55
And instead of "Default" the first entry in the "On dbl-click on empty in folder tree/file list" combo should be "Nothing".
Makes sense.
As far as the white space or empty, either way is fine. I just thought users, even those in dark mode, may key in on white space quicker than empty but maybe not - that may be a just me since I'm so used to on white.
When you end up transferring all the CEA tweaks to the GUI would you end up having a drop down list for the CEA's themselves as well as the current actions and scripts... or list continue to list them separately?