edit prediction: Don't show and discard completion if toggled off in the buffer (#24927)
Discards an inline completion when it's toggled to off (using, say, a keyboard shortcut). This matches the behaviour in VS Code and JetBrains, and I think is a bit more intuitive. (https://github.com/zed-industries/zed/discussions/24895) Release Notes: - N/A
This commit is contained in:
parent
2581f8be92
commit
191a1d7b10
1 changed files with 6 additions and 1 deletions
|
@ -1953,8 +1953,13 @@ impl Editor {
|
||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) {
|
) {
|
||||||
self.show_inline_completions_override = show_edit_predictions;
|
self.show_inline_completions_override = show_edit_predictions;
|
||||||
|
|
||||||
|
if let Some(false) = show_edit_predictions {
|
||||||
|
self.discard_inline_completion(false, cx);
|
||||||
|
} else {
|
||||||
self.refresh_inline_completion(false, true, window, cx);
|
self.refresh_inline_completion(false, true, window, cx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn inline_completions_disabled_in_scope(
|
fn inline_completions_disabled_in_scope(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue