aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display/damage.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2024-10-29 04:02:42 +0000
committerGitHub <noreply@github.com>2024-10-29 07:02:42 +0300
commit0542d9f4f57a8b052234bf8b15d44aef8f90c00a (patch)
tree3b62f1ae9b289a3bc577f281d3c37cad14180dff /alacritty/src/display/damage.rs
parentc2782ad619613d79be453abba6bd58ba98cfe239 (diff)
downloadr-alacritty-0542d9f4f57a8b052234bf8b15d44aef8f90c00a.tar.gz
r-alacritty-0542d9f4f57a8b052234bf8b15d44aef8f90c00a.tar.bz2
r-alacritty-0542d9f4f57a8b052234bf8b15d44aef8f90c00a.zip
Fix hint highlight invalidation
This fixes a couple issues with hint highlight invalidation, which would cause hints to lose their underline highlight despite the terminal itself not having changed since the highlight started. Closes #8270.
Diffstat (limited to 'alacritty/src/display/damage.rs')
-rw-r--r--alacritty/src/display/damage.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/alacritty/src/display/damage.rs b/alacritty/src/display/damage.rs
index 8efe0133..fc6aef39 100644
--- a/alacritty/src/display/damage.rs
+++ b/alacritty/src/display/damage.rs
@@ -193,9 +193,11 @@ impl FrameDamage {
/// Check if a range is damaged.
#[inline]
pub fn intersects(&self, start: Point<usize>, end: Point<usize>) -> bool {
+ let start_line = &self.lines[start.line];
+ let end_line = &self.lines[end.line];
self.full
- || self.lines[start.line].left <= start.column
- || self.lines[end.line].right >= end.column
+ || (start_line.left..=start_line.right).contains(&start.column)
+ || (end_line.left..=end_line.right).contains(&end.column)
|| (start.line + 1..end.line).any(|line| self.lines[line].is_damaged())
}
}