diff options
author | Christian Duerr <contact@christianduerr.com> | 2024-11-02 20:05:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-02 20:05:51 +0000 |
commit | fd745a9f4cb3ba81623167c9d1117747353db33a (patch) | |
tree | effc8817d4d024dd80477fce123bcd2335b95874 /alacritty/src/display/content.rs | |
parent | 39ea7271e32ad88280191d8040d6f8feafe4307a (diff) | |
download | r-alacritty-fd745a9f4cb3ba81623167c9d1117747353db33a.tar.gz r-alacritty-fd745a9f4cb3ba81623167c9d1117747353db33a.tar.bz2 r-alacritty-fd745a9f4cb3ba81623167c9d1117747353db33a.zip |
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.
Diffstat (limited to 'alacritty/src/display/content.rs')
-rw-r--r-- | alacritty/src/display/content.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index 2fbbdec4..edd2709f 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -150,7 +150,7 @@ impl<'a> RenderableContent<'a> { } } -impl<'a> Iterator for RenderableContent<'a> { +impl Iterator for RenderableContent<'_> { type Item = RenderableCell; /// Gets the next renderable cell. @@ -453,7 +453,7 @@ struct Hint<'a> { labels: &'a Vec<Vec<char>>, } -impl<'a> Hint<'a> { +impl Hint<'_> { /// Advance the hint iterator. /// /// If the point is within a hint, the keyboard shortcut character that should be displayed at @@ -543,7 +543,7 @@ impl<'a> HintMatches<'a> { } } -impl<'a> Deref for HintMatches<'a> { +impl Deref for HintMatches<'_> { type Target = [Match]; fn deref(&self) -> &Self::Target { |