mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
copilot: Propagate action if suggest_next is not possible. (#3129)
One of our users ran into an issue where typing "true quote" characters (option-[ for „ and option-] for ‚) was not possible; I've narrowed it down to a collision with Copilot's NextSuggestion and PreviousSuggestion action default keybinds. I explicitly did not want to alter the key bindings, so I've went with a more neutral fix - one that propagates the keystroke if there's no Copilot action to be taken (user is not using Copilot etc). Note however that typing true quotes while using a Copilot is still not possible, as for that we'd have to change a keybind. Fixes zed-industries/community#2072 Release Notes: - Fixed Copilot's "Suggest next" and "Suggest previous" actions colliding with true quotes key bindings (`option-[` and `option-]`). The keystrokes are now propagated if there's no Copilot action to be taken at cursor's position.
This commit is contained in:
parent
2323fd17b0
commit
6f4008ebab
1 changed files with 8 additions and 2 deletions
|
@ -4158,7 +4158,10 @@ impl Editor {
|
|||
if self.has_active_copilot_suggestion(cx) {
|
||||
self.cycle_copilot_suggestions(Direction::Next, cx);
|
||||
} else {
|
||||
self.refresh_copilot_suggestions(false, cx);
|
||||
let is_copilot_disabled = self.refresh_copilot_suggestions(false, cx).is_none();
|
||||
if is_copilot_disabled {
|
||||
cx.propagate_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4170,7 +4173,10 @@ impl Editor {
|
|||
if self.has_active_copilot_suggestion(cx) {
|
||||
self.cycle_copilot_suggestions(Direction::Prev, cx);
|
||||
} else {
|
||||
self.refresh_copilot_suggestions(false, cx);
|
||||
let is_copilot_disabled = self.refresh_copilot_suggestions(false, cx).is_none();
|
||||
if is_copilot_disabled {
|
||||
cx.propagate_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue