From 2c9a050bbbe962fc3953ea78ef869b6324c99c53 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 15 Jul 2026 10:52:44 +0545 Subject: [PATCH] fix(spotlight): run immediate search on Enter when debounced results empty on_entry_changed uses @debounce(300). When user presses Enter before debounce fires, _current_results is empty so nothing activates. Now on_entry_accept triggers an immediate search_single when active plugin has no results, and activates the first result on callback. --- src/window/spotlight/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/window/spotlight/main.py b/src/window/spotlight/main.py index 91f0af7..5d853a9 100644 --- a/src/window/spotlight/main.py +++ b/src/window/spotlight/main.py @@ -638,10 +638,16 @@ class Spotlight(Box): return if self._active_plugin_entry: - inst = self._active_plugin_entry.instance - if inst: - inst.on_submit(entry.get_text()) + text = entry.get_text() entry.set_text("") + + def _on_immediate_results(results): + if results: + self._activate_result(results[0]) + + self.plugin_service.pipeline.search_single( + self._active_plugin_entry, text, _on_immediate_results + ) return # External commands