diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/grid/mod.rs | 5 | ||||
-rw-r--r-- | src/term/mod.rs | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cd7ab1de..b61d1aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow disabling URL launching by setting the value of `mouse.url.launcher` to `None` - Corrected the `window.decorations` config documentation for macOS - Fix IME position on HiDPI displays +- URLs not opening while terminal is scrolled ## Version 0.2.7 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<T> Grid<T> { 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> { diff --git a/src/term/mod.rs b/src/term/mod.rs index 487ba20d..c49ecbcc 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -97,10 +97,11 @@ impl Search for Term { } fn url_search(&self, mut point: Point<usize>) -> Option<String> { + // Switch first line from top to bottom point.line = self.grid.num_lines().0 - point.line - 1; - // Limit the starting point to the last line in the history - point.line = min(point.line, self.grid.len() - 1); + // Remove viewport scroll offset + point.line += self.grid.display_offset(); // Create forwards and backwards iterators let iterf = self.grid.iter_from(point); |