bakkeby / dmenu-flexipatch

A dmenu build with preprocessor directives to decide which patches to include during build time
MIT License
183 stars 78 forks source link

Conflict between printindex patch and multiselection patch #10

Closed ghost closed 2 years ago

ghost commented 2 years ago

I designed the following experiment: Created 3 directories with dmenu-flexipatch:

dmenu-flexipatch doesn't have enabled patches. It is compiled right after cloning the repo. I just typed $ make

dmenu-flexipatch-index only has printindex patch enabled:

define PRINTINDEX_PATCH 1

dmenu-flexipatch-index-conflict has printindex and multiselection patches enabled:

define MULTI_SELECTION_PATCH 1

define PRINTINDEX_PATCH 1

Then after compiling everything I run the following commands:

For dmenu-flexipatch: $ echo -e "Hello\nWorld\nfoo" | ./dmenu-flexipatch/dmenu Press Enter OUTPUT: Hello dmenu-flexipatch works as expected

For dmenu-flexipatch-index: $ echo -e "Hello\nWorld\nfoo" | ./dmenu-flexipatch-index/dmenu Press Enter OUTPUT: Hello dmenu-flexipatch-index works as expected with no option $ echo -e "Hello\nWorld\nfoo" | ./dmenu-flexipatch-index/dmenu -ix Press Enter OUTPUT: 0 dmenu-flexipatch-index works as expected with ix option

For dmenu-flexipatch-index-conflict: $ echo -e "Hello\nWorld\nfoo" | ./dmenu-flexipatch-index-conflict/dmenu Press Enter OUTPUT: 0 dmenu-flexipatch-index-conflict is not working as expected $ echo -e "Hello\nWorld\nfoo" | ./dmenu-flexipatch-index-conflict/dmenu -ix Press Enter OUTPUT: 0 dmenu-flexipatch-index-conflict is not working as expected, with ix option

I don't know if it is a bug but in the description of PRINTINDEX_PATCH there is no mention of an option or flag, so I am not sure if this is intended to be working this way

/* This patch allows dmenu to print out the 0-based index of matched text instead of the matched

bakkeby commented 2 years ago

The above should address the issue you are seeing. Not all patch combinations are compatible unfortunately. I have better cross patch support in my personal build of dmenu which helps making improvements to this flexipatch build in situations like this.