Fix cursor blinking

This commit is contained in:
Antonio Scandurra 2021-03-25 17:39:16 +01:00
parent 596fc47a68
commit e44ea6b379

View file

@ -1058,13 +1058,14 @@ impl BufferView {
ctx.notify(); ctx.notify();
let epoch = self.next_blink_epoch(); let epoch = self.next_blink_epoch();
let _ = ctx.spawn( ctx.spawn(
async move { async move {
Timer::after(CURSOR_BLINK_INTERVAL).await; Timer::after(CURSOR_BLINK_INTERVAL).await;
epoch epoch
}, },
Self::resume_cursor_blinking, Self::resume_cursor_blinking,
); )
.detach();
} }
fn resume_cursor_blinking(&mut self, epoch: usize, ctx: &mut ViewContext<Self>) { fn resume_cursor_blinking(&mut self, epoch: usize, ctx: &mut ViewContext<Self>) {
@ -1080,13 +1081,14 @@ impl BufferView {
ctx.notify(); ctx.notify();
let epoch = self.next_blink_epoch(); let epoch = self.next_blink_epoch();
let _ = ctx.spawn( ctx.spawn(
async move { async move {
Timer::after(CURSOR_BLINK_INTERVAL).await; Timer::after(CURSOR_BLINK_INTERVAL).await;
epoch epoch
}, },
Self::blink_cursors, Self::blink_cursors,
); )
.detach();
} }
} }