Skip to content

Commit 647a748

Browse files
authored
Merge pull request #112 from ynqa/tab
fix: do not replace text when tab with empty candidates
2 parents ecb4685 + 3899506 commit 647a748

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rustix = { version = "1.1.4", features = ["stdio"] }
1919
serde = "1.0.228"
2020
termcfg = { version = "0.2.0", features = ["crossterm_0_29_0"] }
2121
tokio = { version = "1.50.0", features = ["full"] }
22-
toml = "1.1.0+spec-1.1.0"
22+
toml = "1.1.0"
2323

2424
# jaq dependencies
2525
jaq-core = "2.2.1"

src/completion.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ impl CompletionNavigator {
179179
event: &Event,
180180
completion_keybinds: &CompletionKeybinds,
181181
) -> Option<String> {
182+
if self.state.listbox.is_empty() {
183+
return None;
184+
}
185+
182186
// Move up.
183187
if completion_keybinds.up.contains(event) {
184188
self.state.listbox.backward();
@@ -270,6 +274,8 @@ pub fn start_completion_task(
270274
guide_action_tx
271275
.send(GuideAction::Show(GuideMessage::NoSuggestionFound(prefix)))
272276
.await?;
277+
shared_ctx.set_active_index(Index::QueryEditor).await;
278+
completion.clear_session_state();
273279
}
274280
}
275281
}

0 commit comments

Comments
 (0)