diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 26d7f2f87506e2e43f708a3949ae4c763f621ea4..9827be2f6e81db70ef2eff86ea14e61c7a16cdb8 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3493,9 +3493,11 @@ impl Editor { fn set_selections(&mut self, selections: Arc<[Selection]>, cx: &mut ViewContext) { self.selections = selections; - self.buffer.update(cx, |buffer, cx| { - buffer.set_active_selections(&self.selections, cx) - }); + if self.focused { + self.buffer.update(cx, |buffer, cx| { + buffer.set_active_selections(&self.selections, cx) + }); + } } pub fn request_autoscroll(&mut self, autoscroll: Autoscroll, cx: &mut ViewContext) { @@ -3721,6 +3723,10 @@ impl Editor { } fn pause_cursor_blinking(&mut self, cx: &mut ViewContext) { + if !self.focused { + return; + } + self.show_local_cursors = true; cx.notify();