nerevar / jmc

JMC - Jaba Mud Client
25 stars 15 forks source link

#unaction does not work for regexp actions #88

Open mlengle opened 1 year ago

mlengle commented 1 year ago

Steps to reproduce:

act {/[\d+]/}{test};

act;

unact {/[\d+]/};

act

probably there's a bug around "/" escaping

konelav commented 1 year ago

It's related to TinTin legacy feature of 'bulk/wildcard unaction', e.g. #unact {*axe*} removes all actions that contain 'axe' substring. This feature requires some method of escaping asterisk, and uses backslash for this purpose, thus first argument of act and unact has somewhat different syntax (in act asterisk and backslash are just asterisk and backslash, without special meaning).

In your case #unact {/[\\d+]/} should work, I think.

I agree that this syntax difference is counter intuitive, but I am not sure that it should be fixed, because 'fix' will brake backward compatibility (if there is someone who use this feature with mass-removing actions). And I think there are many other places with such logic in TinTin's legacy.

mlengle commented 1 year ago

I think main problem here is the lack of the documentation for the very basic stuff like this. Otherwise I'm ok about keeping it as it is now