@@ -34,7 +34,6 @@ use std::{
34 io::{stdin, stdout},
34 io::{stdin, stdout},
35 path::Path,
35 path::Path,
36 sync::Arc,
36 sync::Arc,
37− time::{Duration, Instant},
40use anyhow::{Context, Error};
39use anyhow::{Context, Error};
@@ -45,8 +44,6 @@ use {signal_hook::consts::signal, signal_hook_tokio::Signals};
45#[cfg(windows)]
44#[cfg(windows)]
46type Signals = futures_util::stream::Empty<()>;
45type Signals = futures_util::stream::Empty<()>;
48−const LSP_DEADLINE: Duration = Duration::from_millis(16);
50#[cfg(not(feature = "integration"))]
47#[cfg(not(feature = "integration"))]
51use tui::backend::CrosstermBackend;
48use tui::backend::CrosstermBackend;
@@ -76,7 +73,6 @@ pub struct Application {
76 signals: Signals,
73 signals: Signals,
77 jobs: Jobs,
74 jobs: Jobs,
78 lsp_progress: LspProgressMap,
75 lsp_progress: LspProgressMap,
79− last_render: Instant,
82#[cfg(feature = "integration")]
78#[cfg(feature = "integration")]
@@ -253,7 +249,6 @@ impl Application {
254 jobs: Jobs::new(),
250 jobs: Jobs::new(),
255 lsp_progress: LspProgressMap::new(),
251 lsp_progress: LspProgressMap::new(),
256− last_render: Instant::now(),
@@ -300,7 +295,6 @@ impl Application {
300 S: Stream<Item = crossterm::Result<crossterm::event::Event>> + Unpin,
295 S: Stream<Item = crossterm::Result<crossterm::event::Event>> + Unpin,
302 self.render().await;
297 self.render().await;
303− self.last_render = Instant::now();
306 if !self.event_loop_until_idle(input_stream).await {
300 if !self.event_loop_until_idle(input_stream).await {
@@ -609,12 +603,7 @@ impl Application {
609 EditorEvent::LanguageServerMessage((id, call)) => {
603 EditorEvent::LanguageServerMessage((id, call)) => {
610 self.handle_language_server_message(call, id).await;
604 self.handle_language_server_message(call, id).await;
611 // limit render calls for fast language server messages
605 // limit render calls for fast language server messages
612− let last = self.editor.language_servers.incoming.is_empty();
606+ self.editor.redraw_handle.0.notify_one();
614− if last || self.last_render.elapsed() > LSP_DEADLINE {
615− self.render().await;
616− self.last_render = Instant::now();
619 EditorEvent::DebuggerEvent(payload) => {
608 EditorEvent::DebuggerEvent(payload) => {
620 let needs_render = self.editor.handle_debugger_message(payload).await;
609 let needs_render = self.editor.handle_debugger_message(payload).await;