0

Define a custom filter method for the quick panel

Ben Weier 10 aastat tagasi 0
My plugin is using the quick panel to show a list of available colour schemes. I'm currently showing some text next to the scheme name to indicate whether it is a Dark or Light scheme.

Rather than putting [Dark] or [Light] visibly in the scheme list, I'd like to define an on_filter method triggered whenever the user types a certain symbol like ":" that will accept the current quick panel items, and filter text as parameters. I can then return a new list of items based on the users' filter text. Sublime can continue its own filtering before or after the

Or instead of leaving the filter method up to the developer, allow hidden attributes to be attached to the list item that will be matched by Sublime's normal filtering method. e.g. using ":" to trigger an attribute match, or "!" to trigger a NOT match.