Skip to content

Commit

Permalink
assistant: Add missing toggle model selector action handler (zed-indu…
Browse files Browse the repository at this point in the history
…stries#25248)

zed-industries#25032 removes handling of `ToggleModelSelector` action. This PR adds
missing handler to context editor.

Release Notes:

- N/A
  • Loading branch information
SirSilver authored Feb 20, 2025
1 parent 48541fb commit 43f2e4c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/assistant_context_editor/src/context_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,15 @@ impl ContextEditor {
});
}

fn toggle_model_selector(
&mut self,
_: &ToggleModelSelector,
window: &mut Window,
cx: &mut Context<Self>,
) {
self.language_model_selector_menu_handle.toggle(window, cx);
}

fn save(&mut self, _: &Save, _window: &mut Window, cx: &mut Context<Self>) {
self.context.update(cx, |context, cx| {
context.save(Some(Duration::from_millis(500)), self.fs.clone(), cx)
Expand Down Expand Up @@ -2886,6 +2895,7 @@ impl Render for ContextEditor {
.on_action(cx.listener(ContextEditor::edit))
.on_action(cx.listener(ContextEditor::assist))
.on_action(cx.listener(ContextEditor::split))
.on_action(cx.listener(ContextEditor::toggle_model_selector))
.size_full()
.children(self.render_notice(cx))
.child(
Expand Down

0 comments on commit 43f2e4c

Please sign in to comment.