diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-06-06 11:00:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 11:00:39 +0300 |
commit | bb7b1201c9dcb5379ed58ae04e065f042a2daa7f (patch) | |
tree | 9057ca8d234fccdab7c609db526f4340d6cb7d4d | |
parent | 56a69c0bfe5742aeda1c4942b748f5a842ce6773 (diff) | |
download | alacritty-bb7b1201c9dcb5379ed58ae04e065f042a2daa7f.tar.gz alacritty-bb7b1201c9dcb5379ed58ae04e065f042a2daa7f.zip |
Fix crash when damaging off-screen hint
Co-authored-by: Christian Duerr <contact@christianduerr.com>
-rw-r--r-- | alacritty/src/display/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index 91f575e4..eb7b8d53 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -1061,9 +1061,11 @@ impl Display { #[inline] fn damage_highlighted_hints<T: EventListener>(&self, terminal: &mut Term<T>) { let display_offset = terminal.grid().display_offset(); + let last_visible_line = terminal.screen_lines() - 1; for hint in self.highlighted_hint.iter().chain(&self.vi_highlighted_hint) { for point in (hint.bounds.start().line.0..=hint.bounds.end().line.0).flat_map(|line| { term::point_to_viewport(display_offset, Point::new(Line(line), Column(0))) + .filter(|point| point.line <= last_visible_line) }) { terminal.damage_line(point.line, 0, terminal.columns() - 1); } |