From 1460e185abb1418697734955ed20815bf01e79bd Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 2 Nov 2024 20:05:51 +0000 Subject: Fix racing condition in hint triggering This fixes an issue with hints where it was possible that the terminal content of highlighted hints changed between the highlighted hint update and the activation of the hint. This patch always validates the hint's text content against the hint itself to ensure that the content is still valid for the original hint which triggered the highlight. Closes #8277. --- alacritty_terminal/src/grid/mod.rs | 2 +- alacritty_terminal/src/term/mod.rs | 2 +- alacritty_terminal/src/term/search.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'alacritty_terminal') diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index 278bea3b..fbd2c79e 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -615,7 +615,7 @@ pub trait BidirectionalIterator: Iterator { fn prev(&mut self) -> Option; } -impl<'a, T> BidirectionalIterator for GridIterator<'a, T> { +impl BidirectionalIterator for GridIterator<'_, T> { fn prev(&mut self) -> Option { let topmost_line = self.grid.topmost_line(); let last_column = self.grid.last_column(); diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 8a0410dc..1f1e52c1 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -199,7 +199,7 @@ impl<'a> TermDamageIterator<'a> { } } -impl<'a> Iterator for TermDamageIterator<'a> { +impl Iterator for TermDamageIterator<'_> { type Item = LineDamageBounds; fn next(&mut self) -> Option { diff --git a/alacritty_terminal/src/term/search.rs b/alacritty_terminal/src/term/search.rs index 33f6ee05..20a427b7 100644 --- a/alacritty_terminal/src/term/search.rs +++ b/alacritty_terminal/src/term/search.rs @@ -656,7 +656,7 @@ impl<'a, T> RegexIter<'a, T> { } } -impl<'a, T> Iterator for RegexIter<'a, T> { +impl Iterator for RegexIter<'_, T> { type Item = Match; fn next(&mut self) -> Option { -- cgit v1.2.3-54-g00ecf