@@ -918,6 +918,7 @@ pub struct Editor {
918918 pub auto_pairs: Option<AutoPairs>,
919919
920920 pub idle_timer: Pin<Box<Sleep>>,
921+ redraw_timer: Pin<Box<Sleep>>,
921922 last_motion: Option<Motion>,
922923 pub last_completion: Option<CompleteAction>,
923924
@@ -963,6 +964,7 @@ pub enum EditorEvent {
963964 LanguageServerMessage((usize, Call)),
964965 DebuggerEvent(dap::Payload),
965966 IdleTimer,
967+ Redraw,
966968}
967969
968970#[derive(Debug, Clone)]
@@ -1053,6 +1055,7 @@ impl Editor {
10531055 status_msg: None,
10541056 autoinfo: None,
10551057 idle_timer: Box::pin(sleep(conf.idle_timeout)),
1058+ redraw_timer: Box::pin(sleep(Duration::MAX)),
10561059 last_motion: None,
10571060 last_completion: None,
10581061 config,
@@ -1753,12 +1756,16 @@ impl Editor {
17531756 if !self.needs_redraw{
17541757 self.needs_redraw = true;
17551758 let timeout = Instant::now() + Duration::from_millis(33);
1756− if timeout < self.idle_timer.deadline(){
1757− self.idle_timer.as_mut().reset(timeout)
1759+ if timeout < self.idle_timer.deadline() && timeout < self.redraw_timer.deadline(){
1760+ self.redraw_timer.as_mut().reset(timeout)
17581761 }
17591762 }
17601763 }
17611764
1765+ _ = &mut self.redraw_timer => {
1766+ self.redraw_timer.as_mut().reset(Instant::now() + Duration::from_secs(86400 * 365 * 30));
1767+ return EditorEvent::Redraw
1768+ }
17621769 _ = &mut self.idle_timer => {
17631770 return EditorEvent::IdleTimer
17641771 }