-
Notifications
You must be signed in to change notification settings - Fork 52
fix: clear should not remove data from other plugins #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
So far, I haven't been able to find anywhere where this changes behavior with the default plugins. I do see some places where comments in the documentation or code might need to be updated to match this change? Line 154 in 0febac5
Line 72 in 0febac5
|
Oh, I'm sorry, I forgot add my motivation to fix this! First and foremost: this fix is not necessary to run the default plugins. In fact, most of the default plugins don't use the "Clear" command at all. The reason being that none of the default plugins provide data "proactively" instead plugins like the calc plugin provide data "reactively". They wait for a user input which clears the current list of items implicitly and invokes a "Search" command on the plugin which then adds search results. This works well for most of the use cases. However, I implemented a clock plugin (which tells the current time, accurate to seconds) which needs to update data "proactively". It uses "Clear" to delete the old time entry and adds another one afterwards even if there was no user interaction at all. Here is the source for that clock plugin:
FYI: I'm currently migrating all my launcher plugins to pop-launcher and of course all of this is open source :>. https://github.com/friedow/dotfiles and plugins: https://github.com/friedow/dotfiles/tree/main/modules/onagre |
Wouldn't it be better for the plugin to store the time, and only give a search result when requested by a search? |
Behavior After this Change
When a plugin calls "Clear", the search results of this specific plugin are cleared.
Behavior Before this Change
When a plugin calls "Clear", the search results of all plugins are cleared.