diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-03-24 17:37:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-24 17:37:30 +0000 |
commit | 3e36d714fec8139a1e506036a394b343bd1a8bb4 (patch) | |
tree | 88cd59c895bfec86b787fac84f93713683fb502a /src/event.rs | |
parent | d8272662db4a4dc1ef58b8379dc88162066a3241 (diff) | |
download | r-alacritty-3e36d714fec8139a1e506036a394b343bd1a8bb4.tar.gz r-alacritty-3e36d714fec8139a1e506036a394b343bd1a8bb4.tar.bz2 r-alacritty-3e36d714fec8139a1e506036a394b343bd1a8bb4.zip |
Fix URL highlight crash
The URL highlight stores the state of the last URL highlight with the
position of the URL start position. However when resizing, it's possible
that the indices of this point change which will cause a crash if the
old positions are not within the grid anymore.
This has been resolved by resetting the URL highlight state whenever the
terminal is resized.
The original PR incorrectly required the shift modifier to be required
when the user was in the alternate screen buffer. However the correct
behavior is to require it when the mouse mode is enabled.
This has been resolved and URLs are now highlighted in the alt screen
even if no shift modifier is pressed.
This fixes #2194.
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/event.rs b/src/event.rs index 76e7e111..121c0c42 100644 --- a/src/event.rs +++ b/src/event.rs @@ -10,7 +10,7 @@ use std::env; use serde_json as json; use parking_lot::MutexGuard; -use glutin::{self, ModifiersState, Event, ElementState, MouseButton, MouseCursor}; +use glutin::{self, ModifiersState, Event, ElementState, MouseButton}; use copypasta::{Clipboard, Load, Store, Buffer as ClipboardBuffer}; use glutin::dpi::PhysicalSize; @@ -222,13 +222,6 @@ pub enum ClickState { TripleClick, } -/// Temporary save state for restoring mouse cursor and underline after unhovering a URL. -pub struct UrlHoverSaveState { - pub mouse_cursor: MouseCursor, - pub underlined: Vec<bool>, - pub start: Point<usize>, -} - /// State of the mouse pub struct Mouse { pub x: usize, @@ -245,7 +238,6 @@ pub struct Mouse { pub lines_scrolled: f32, pub block_url_launcher: bool, pub last_button: MouseButton, - pub url_hover_save: Option<UrlHoverSaveState>, } impl Default for Mouse { @@ -265,7 +257,6 @@ impl Default for Mouse { lines_scrolled: 0.0, block_url_launcher: false, last_button: MouseButton::Other(0), - url_hover_save: None, } } } |