diff options
author | Christian Duerr <contact@christianduerr.com> | 2019-11-04 00:14:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-04 00:14:23 +0100 |
commit | 93e87eb0f1858138113d4ecdfaa8bfac3c127a39 (patch) | |
tree | 8c7a1083907c6efabad3de0e6a875c665c500b0e /alacritty/src | |
parent | b47a88b142a8987f1d0d48db8c0db1e5f3048a76 (diff) | |
download | r-alacritty-93e87eb0f1858138113d4ecdfaa8bfac3c127a39.tar.gz r-alacritty-93e87eb0f1858138113d4ecdfaa8bfac3c127a39.tar.bz2 r-alacritty-93e87eb0f1858138113d4ecdfaa8bfac3c127a39.zip |
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.
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/event.rs | 7 | ||||
-rw-r--r-- | alacritty/src/input.rs | 18 |
2 files changed, 10 insertions, 15 deletions
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<N: Notify> Processor<N> { 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<MouseState> for CursorIcon { } impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> { - pub fn new( - ctx: A, - urls: &'a Urls, - highlighted_url: &'a Option<Url>, - ) -> Self { + pub fn new(ctx: A, urls: &'a Urls, highlighted_url: &'a Option<Url>) -> Self { Self { ctx, urls, highlighted_url, _phantom: Default::default() } } @@ -646,10 +642,12 @@ impl<'a, T: EventListener, A: ActionContext<T>> 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 + } }, }; |