Skip to content

Commit 84535aa

Browse files
committed
fix: do not replace text when suggestions are empty
1 parent ecb4685 commit 84535aa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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.len() == 0 {
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)