Run slash commands both on enter and on argument completion that requires it (#16283)
Release Notes: - N/A
This commit is contained in:
@@ -4379,11 +4379,11 @@ impl Editor {
|
||||
this.refresh_inline_completion(true, cx);
|
||||
});
|
||||
|
||||
if let Some(confirm) = completion.confirm.as_ref() {
|
||||
(confirm)(intent, cx);
|
||||
}
|
||||
|
||||
if completion.show_new_completions_on_confirm {
|
||||
let show_new_completions_on_confirm = completion
|
||||
.confirm
|
||||
.as_ref()
|
||||
.map_or(false, |confirm| confirm(intent, cx));
|
||||
if show_new_completions_on_confirm {
|
||||
self.show_completions(&ShowCompletions { trigger: None }, cx);
|
||||
}
|
||||
|
||||
@@ -11926,6 +11926,12 @@ impl Editor {
|
||||
let bounds = self.last_bounds?;
|
||||
Some(element::gutter_bounds(bounds, self.gutter_dimensions))
|
||||
}
|
||||
|
||||
pub fn has_active_completions_menu(&self) -> bool {
|
||||
self.context_menu.read().as_ref().map_or(false, |menu| {
|
||||
menu.visible() && matches!(menu, ContextMenu::Completions(_))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn hunks_for_selections(
|
||||
@@ -12141,7 +12147,6 @@ fn snippet_completions(
|
||||
..Default::default()
|
||||
},
|
||||
confirm: None,
|
||||
show_new_completions_on_confirm: false,
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user