Skip to content

Comments

TextFilter: improve behavior for multiple filters#5567

Open
phisko wants to merge 1 commit intoocornut:masterfrom
phisko:patch-1
Open

TextFilter: improve behavior for multiple filters#5567
phisko wants to merge 1 commit intoocornut:masterfrom
phisko:patch-1

Conversation

@phisko
Copy link

@phisko phisko commented Aug 12, 2022

PassFilter will now return true if all required ranges are found

The current behavior is rather inconsistent: given "Some fancy sentence" as text, PassFilter will:

  • return true if the filter is fancy,-sentence
  • return false if the filter is -sentence,fancy
  • return true if the filter is fancy,random

From my experience, this isn't what end users expect when using a search filter.

This also simplifies the code, and removes the CountGrep mechanism.

PassFilter will now return true if all required ranges are found
@ocornut
Copy link
Owner

ocornut commented Aug 20, 2022

Seems similar to #2435

@phisko
Copy link
Author

phisko commented Aug 22, 2022

Indeed, for some reason #2435 didn't come up in my search results before implementing this, but it's a more complete version of this (although it doesn't simplify the code quite as much). From what I can see you're interested in that PR but haven't had time to take a look at it in detail. Do you have some sort of ETA for when you might?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants