From e561ae373393e919cf3dbbf123a98e0aad215dbc Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 7 Feb 2019 00:55:18 +0000 Subject: Fix unclickable URLs with scrolled viewport Since scrolling the terminal moves around the underlying data structure of the terminal, the URL selection would search for the URL at the position where the click would have been without any scrolling. By adding the viewport offset to the click position, the URL clicking now searches at the correct location. This fixes https://github.com/jwilm/alacritty/issues/2076. --- src/grid/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/grid/mod.rs') diff --git a/src/grid/mod.rs b/src/grid/mod.rs index a00fed40..fd22b716 100644 --- a/src/grid/mod.rs +++ b/src/grid/mod.rs @@ -465,6 +465,11 @@ impl Grid { pub fn contains(&self, point: &Point) -> bool { self.lines > point.line && self.cols > point.col } + + #[inline] + pub fn display_offset(&self) -> usize { + self.display_offset + } } impl<'a, T> Iterator for GridIterator<'a, T> { -- cgit