From 84535aa0aac88bdf23c373abf0d37fc51226a5b1 Mon Sep 17 00:00:00 2001 From: ynqa Date: Mon, 30 Mar 2026 22:38:03 +0900 Subject: [PATCH 1/2] fix: do not replace text when suggestions are empty --- src/completion.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/completion.rs b/src/completion.rs index 4e61ca3..dba824b 100644 --- a/src/completion.rs +++ b/src/completion.rs @@ -179,6 +179,10 @@ impl CompletionNavigator { event: &Event, completion_keybinds: &CompletionKeybinds, ) -> Option { + if self.state.listbox.len() == 0 { + return None; + } + // Move up. if completion_keybinds.up.contains(event) { self.state.listbox.backward(); @@ -270,6 +274,8 @@ pub fn start_completion_task( guide_action_tx .send(GuideAction::Show(GuideMessage::NoSuggestionFound(prefix))) .await?; + shared_ctx.set_active_index(Index::QueryEditor).await; + completion.clear_session_state(); } } } From 3899506a8381dfe5db90f7281053b1ebaf20070e Mon Sep 17 00:00:00 2001 From: ynqa Date: Mon, 30 Mar 2026 22:48:48 +0900 Subject: [PATCH 2/2] cargo-clippy --- Cargo.toml | 2 +- src/completion.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e452fac..7d5489e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ rustix = { version = "1.1.4", features = ["stdio"] } serde = "1.0.228" termcfg = { version = "0.2.0", features = ["crossterm_0_29_0"] } tokio = { version = "1.50.0", features = ["full"] } -toml = "1.1.0+spec-1.1.0" +toml = "1.1.0" # jaq dependencies jaq-core = "2.2.1" diff --git a/src/completion.rs b/src/completion.rs index dba824b..419f016 100644 --- a/src/completion.rs +++ b/src/completion.rs @@ -179,7 +179,7 @@ impl CompletionNavigator { event: &Event, completion_keybinds: &CompletionKeybinds, ) -> Option { - if self.state.listbox.len() == 0 { + if self.state.listbox.is_empty() { return None; }