From 93e87eb0f1858138113d4ecdfaa8bfac3c127a39 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Mon, 4 Nov 2019 00:14:23 +0100 Subject: Fix incorrect cell foreground when clearing screen This fixes a bug that would clear the cells with the current template cell with just the `flags` reset, to make sure the colors are correct. However, the cell foreground was not reset, leading to cells counting as occupied when resizing. With this change both cell flags and foreground color are ignored when clearing both the whole screen and inside the line, allowing us to accurately keep track of cell occupation. Fixes #2866. --- alacritty/src/event.rs | 7 ++----- alacritty/src/input.rs | 18 ++++++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 5a486206..2cee37fd 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -398,11 +398,8 @@ impl Processor { font_size: &mut self.font_size, config: &mut self.config, }; - let mut processor = input::Processor::new( - context, - &self.display.urls, - &self.display.highlighted_url, - ); + let mut processor = + input::Processor::new(context, &self.display.urls, &self.display.highlighted_url); for event in event_queue.drain(..) { Processor::handle_event(event, &mut processor); diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs index a8b2320f..422d6a3f 100644 --- a/alacritty/src/input.rs +++ b/alacritty/src/input.rs @@ -20,9 +20,9 @@ //! determine what to do when a non-modifier key is pressed. use std::borrow::Cow; use std::cmp::min; +use std::cmp::Ordering; use std::marker::PhantomData; use std::time::Instant; -use std::cmp::Ordering; use glutin::event::{ ElementState, KeyboardInput, ModifiersState, MouseButton, MouseScrollDelta, TouchPhase, @@ -250,11 +250,7 @@ impl From for CursorIcon { } impl<'a, T: EventListener, A: ActionContext> Processor<'a, T, A> { - pub fn new( - ctx: A, - urls: &'a Urls, - highlighted_url: &'a Option, - ) -> Self { + pub fn new(ctx: A, urls: &'a Urls, highlighted_url: &'a Option) -> Self { Self { ctx, urls, highlighted_url, _phantom: Default::default() } } @@ -646,10 +642,12 @@ impl<'a, T: EventListener, A: ActionContext> Processor<'a, T, A> { let new_icon = match current_lines.cmp(&new_lines) { Ordering::Less => CursorIcon::Default, Ordering::Equal => CursorIcon::Hand, - Ordering::Greater => if mouse_mode { - CursorIcon::Default - } else { - CursorIcon::Text + Ordering::Greater => { + if mouse_mode { + CursorIcon::Default + } else { + CursorIcon::Text + } }, }; -- cgit