Don't update active completion for editors that are not focused (#9904)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra
2024-03-28 10:51:55 +01:00
committed by GitHub
parent eaec04632a
commit c33ee52046
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -1676,7 +1676,9 @@ impl Editor {
) {
self.inline_completion_provider = Some(RegisteredInlineCompletionProvider {
_subscription: cx.observe(&provider, |this, _, cx| {
this.update_visible_inline_completion(cx);
if this.focus_handle.is_focused(cx) {
this.update_visible_inline_completion(cx);
}
}),
provider: Arc::new(provider),
});