Avoid expect in slash popup path

This commit is contained in:
Ahmed Ibrahim
2026-01-13 00:48:36 -08:00
parent 93d6307ace
commit 4e4bffce72
2 changed files with 6 additions and 2 deletions

View File

@@ -642,7 +642,9 @@ impl ChatComposer {
} => {
// Ensure popup filtering/selection reflects the latest composer text
// before applying completion.
let ctx = ctx_for_tab.as_ref().expect("tab context must exist");
let Some(ctx) = ctx_for_tab.as_ref() else {
return (InputResult::None, true);
};
let first_line = ctx.first_line();
popup.on_composer_text_change(ctx.prefix().to_string());
if let Some(sel) = popup.selected_item() {

View File

@@ -576,7 +576,9 @@ impl ChatComposer {
} => {
// Ensure popup filtering/selection reflects the latest composer text
// before applying completion.
let ctx = ctx_for_tab.as_ref().expect("tab context must exist");
let Some(ctx) = ctx_for_tab.as_ref() else {
return (InputResult::None, true);
};
let first_line = ctx.first_line();
popup.on_composer_text_change(ctx.prefix().to_string());
if let Some(sel) = popup.selected_item() {