mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
Fix crash when damaging off-screen hint
Co-authored-by: Christian Duerr <contact@christianduerr.com>
This commit is contained in:
parent
56a69c0bfe
commit
bb7b1201c9
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue