diff options
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 39213ee2..0f228f86 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -31,6 +31,7 @@ use config::{Config, VisualBellAnimation}; use {MouseCursor, Rgb}; use copypasta::{Clipboard, Load, Store}; use input::FONT_SIZE_STEP; +use logging::LoggerProxy; pub mod cell; pub mod color; @@ -810,6 +811,9 @@ pub struct Term { /// Automatically scroll to bottom when new lines are added auto_scroll: bool, + + /// Proxy object for clearing displayed errors and warnings + logger_proxy: Option<LoggerProxy>, } /// Terminal size info @@ -936,9 +940,14 @@ impl Term { dynamic_title: config.dynamic_title(), tabspaces, auto_scroll: config.scrolling().auto_scroll, + logger_proxy: None, } } + pub fn set_logger_proxy(&mut self, logger_proxy: LoggerProxy) { + self.logger_proxy = Some(logger_proxy); + } + pub fn change_font_size(&mut self, delta: f32) { // Saturating addition with minimum font size FONT_SIZE_STEP let new_size = self.font_size + Size::new(delta); @@ -1822,6 +1831,11 @@ impl ansi::Handler for Term { } }, ansi::ClearMode::All => { + // Clear displayed errors and warnings + if let Some(ref mut logger_proxy) = self.logger_proxy { + logger_proxy.clear(); + } + self.grid.region_mut(..).each(|c| c.reset(&template)); }, ansi::ClearMode::Above => { |