Release Notes: - N/A
Unified · Split
| @@ -764,6 +764,7 @@ mod tests { · 763 unmodified lines | ||
| 764 | 764 | multibuffer |
| 765 | 765 | }); |
| 766 | 766 | let editor = cx.add_window(|cx| Editor::for_multibuffer(multibuffer, None, cx)); |
| 767 | + editor.update(cx, |editor, cx| editor.focus(cx)).unwrap(); | |
| 767 | 768 | let copilot_provider = cx.new_model(|_| CopilotCompletionProvider::new(copilot)); |
| 768 | 769 | editor |
| 769 | 770 | .update(cx, |editor, cx| { |
| @@ -1676,7 +1676,9 @@ impl Editor { · 1675 unmodified lines | ||
| 1676 | 1676 | ) { |
| 1677 | 1677 | self.inline_completion_provider = Some(RegisteredInlineCompletionProvider { |
| 1678 | 1678 | _subscription: cx.observe(&provider, |this, _, cx| { |
| 1679 | − this.update_visible_inline_completion(cx); | |
| 1679 | + if this.focus_handle.is_focused(cx) { | |
| 1680 | + this.update_visible_inline_completion(cx); | |
| 1681 | + } | |
| 1680 | 1682 | }), |
| 1681 | 1683 | provider: Arc::new(provider), |
| 1682 | 1684 | }); |