summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-05-25 07:52:15 +0300
committerKirill Chibisov <contact@kchibisov.com>2023-06-26 13:42:07 +0400
commit284f2c49a9a61ca9b6dabc6513448b528108227c (patch)
tree8f4f6229a93cca1f01694b0a2e2e278f4c752443
parent5fdfd47f832522b5fbfa111006046561404789a2 (diff)
Fix hyperlink preview for 2 lines terminal (#6953)
The intention was to show it, however it was hidden due to wrong comparisson check.
-rw-r--r--CHANGELOG.md6
-rw-r--r--alacritty/src/display/mod.rs5
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc7424b7..4096bb18 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ The sections should follow the order `Packaging`, `Added`, `Changed`, `Fixed` an
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
+## 0.13.0-dev
+
+### Fixed
+
+- Hyperlink preview not being shown when the terminal has exactly 2 lines
+
## 0.12.1
### Fixed
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs
index 4d9c1540..57343bb7 100644
--- a/alacritty/src/display/mod.rs
+++ b/alacritty/src/display/mod.rs
@@ -1201,10 +1201,9 @@ impl Display {
// The maximum amount of protected lines including the ones we'll show preview on.
let max_protected_lines = uris.len() * 2;
- // Lines we shouldn't shouldn't show preview on, because it'll obscure the highlighted
- // hint.
+ // Lines we shouldn't show preview on, because it'll obscure the highlighted hint.
let mut protected_lines = Vec::with_capacity(max_protected_lines);
- if self.size_info.screen_lines() >= max_protected_lines {
+ if self.size_info.screen_lines() > max_protected_lines {
// Prefer to show preview even when it'll likely obscure the highlighted hint, when
// there's no place left for it.
protected_lines.push(self.hint_mouse_point.map(|point| point.line));