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.
This commit is contained in:
sankalp committed 2026-07-15 10:52:44 +05:45
1 parent 4503130be3
commit 2c9a050bbb
1 file changed
+9 -3
+9 -3
View File
@@ -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