mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Pause cursor blinking only when editor is focused
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
37032f5eb2
commit
3853826f78
1 changed files with 9 additions and 3 deletions
|
@ -3493,9 +3493,11 @@ impl Editor {
|
||||||
|
|
||||||
fn set_selections(&mut self, selections: Arc<[Selection<Anchor>]>, cx: &mut ViewContext<Self>) {
|
fn set_selections(&mut self, selections: Arc<[Selection<Anchor>]>, cx: &mut ViewContext<Self>) {
|
||||||
self.selections = selections;
|
self.selections = selections;
|
||||||
self.buffer.update(cx, |buffer, cx| {
|
if self.focused {
|
||||||
buffer.set_active_selections(&self.selections, cx)
|
self.buffer.update(cx, |buffer, cx| {
|
||||||
});
|
buffer.set_active_selections(&self.selections, cx)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn request_autoscroll(&mut self, autoscroll: Autoscroll, cx: &mut ViewContext<Self>) {
|
pub fn request_autoscroll(&mut self, autoscroll: Autoscroll, cx: &mut ViewContext<Self>) {
|
||||||
|
@ -3721,6 +3723,10 @@ impl Editor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pause_cursor_blinking(&mut self, cx: &mut ViewContext<Self>) {
|
fn pause_cursor_blinking(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
|
if !self.focused {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.show_local_cursors = true;
|
self.show_local_cursors = true;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue