Run slash commands both on enter and on argument completion that requires it (#16283)
Release Notes: - N/A
This commit is contained in:
parent
5a30e29848
commit
c45adce2e3
9 changed files with 61 additions and 34 deletions
|
@ -2081,7 +2081,7 @@ impl ContextEditor {
|
|||
}
|
||||
|
||||
editor.insert(&format!("/{name}"), cx);
|
||||
if command.requires_argument() {
|
||||
if command.accepts_arguments() {
|
||||
editor.insert(" ", cx);
|
||||
editor.show_completions(&ShowCompletions::default(), cx);
|
||||
}
|
||||
|
@ -2094,6 +2094,10 @@ impl ContextEditor {
|
|||
}
|
||||
|
||||
pub fn confirm_command(&mut self, _: &ConfirmCommand, cx: &mut ViewContext<Self>) {
|
||||
if self.editor.read(cx).has_active_completions_menu() {
|
||||
return;
|
||||
}
|
||||
|
||||
let selections = self.editor.read(cx).selections.disjoint_anchors();
|
||||
let mut commands_by_range = HashMap::default();
|
||||
let workspace = self.workspace.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue