Skip to content

Commit

Permalink
Fix hyperlink preview for 2 lines terminal (alacritty#6953)
Browse files Browse the repository at this point in the history
The intention was to show it, however it was hidden due to wrong
comparisson check.
  • Loading branch information
kchibisov committed Jun 25, 2023
1 parent 5fdfd47 commit 7fe7aee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions alacritty/src/display/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7fe7aee

Please sign in to comment.