dmenu-flexipatch icon indicating copy to clipboard operation
dmenu-flexipatch copied to clipboard

instant patch doesn't work

Open tienbuigia opened this issue 1 year ago • 3 comments

It works if I run it like this echo -ne "alskdjf\nlaksdjf\n" | dmenu

If I select a link, it doesn't work echo -ne "alskdjf\nlaksdjf\nhttps://examples.xyz" | dmenu

dmenu_run doesn't work as well.

This isn't just flexipatch but in vanilla version as well. at least mine (version = 5.2; patches: dmenu-caseinsensitive-5.0.diff dmenu-fuzzymatch-4.9.diff dmenu-highlight-20201211-fcdc159.diff dmenu-xresources-4.9.diff).

tienbuigia avatar Apr 21 '23 07:04 tienbuigia

Perhaps it works, just not the way you think it should work?

As per https://tools.suckless.org/dmenu/patches/instant/ we have:

Adds an flag which will cause dmenu to select an item immediately if there is one matching option left.

The patch adds a new command line option -n.

So if we try the command of:

echo -ne "alskdjf\nlaksdjf\nhttps://examples.xyz" | dmenu -n

and you hit h then it should immediately return with https://examples.xyz because none of the other options contain that letter leaving the URL as the remaining option.

bakkeby avatar Apr 21 '23 07:04 bakkeby

There could be some patch incompatibility between the instant patch and the fuzzymatch patch, will have a closer look.

bakkeby avatar Apr 21 '23 07:04 bakkeby

So when patching this manually we need to take into account these lines added to the match function:

+   if(instant && matches && matches==matchend && !lsubstr) {
+       puts(matches->text);
+       cleanup();
+       exit(0);
+   }

ref. https://tools.suckless.org/dmenu/patches/instant/dmenu-instant-4.7.diff

and add something similar to the fuzzymatch function introduced by the fuzzymatch patch.

ref. https://tools.suckless.org/dmenu/patches/fuzzymatch/dmenu-fuzzymatch-4.9.diff

bakkeby avatar Apr 21 '23 07:04 bakkeby

Going to close this down now. Checked this on both dmenu-flexipatch and my personal build and the instant patch seemed to behave as intended.

bakkeby avatar Jul 16 '24 21:07 bakkeby