From e44ea6b37959f63c2a0a58ca94927d9902d32ab6 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 25 Mar 2021 17:39:16 +0100 Subject: [PATCH] Fix cursor blinking --- zed/src/editor/buffer_view.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zed/src/editor/buffer_view.rs b/zed/src/editor/buffer_view.rs index bf050ef5e5..f1e866cf43 100644 --- a/zed/src/editor/buffer_view.rs +++ b/zed/src/editor/buffer_view.rs @@ -1058,13 +1058,14 @@ impl BufferView { ctx.notify(); let epoch = self.next_blink_epoch(); - let _ = ctx.spawn( + ctx.spawn( async move { Timer::after(CURSOR_BLINK_INTERVAL).await; epoch }, Self::resume_cursor_blinking, - ); + ) + .detach(); } fn resume_cursor_blinking(&mut self, epoch: usize, ctx: &mut ViewContext) { @@ -1080,13 +1081,14 @@ impl BufferView { ctx.notify(); let epoch = self.next_blink_epoch(); - let _ = ctx.spawn( + ctx.spawn( async move { Timer::after(CURSOR_BLINK_INTERVAL).await; epoch }, Self::blink_cursors, - ); + ) + .detach(); } }