aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/message_bar.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-03-02 21:49:42 +0300
committerGitHub <noreply@github.com>2023-03-02 21:49:42 +0300
commit66d742d0596203af7ca0e5db47c5b5bc1cc18d91 (patch)
treec2f984bcb9c42b2ac1f0fdd74fcfbcca21a84026 /alacritty/src/message_bar.rs
parentbf5874805576804ab9ae82949624b1122c3015db (diff)
downloadr-alacritty-66d742d0596203af7ca0e5db47c5b5bc1cc18d91.tar.gz
r-alacritty-66d742d0596203af7ca0e5db47c5b5bc1cc18d91.tar.bz2
r-alacritty-66d742d0596203af7ca0e5db47c5b5bc1cc18d91.zip
Fix busy rendering when the same warning persists
When the same warning is thrown on the each rendering iteration, it'll force alacritty to always render. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty/src/message_bar.rs')
-rw-r--r--alacritty/src/message_bar.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/alacritty/src/message_bar.rs b/alacritty/src/message_bar.rs
index 988a6a31..267f8322 100644
--- a/alacritty/src/message_bar.rs
+++ b/alacritty/src/message_bar.rs
@@ -181,6 +181,12 @@ impl MessageBuffer {
pub fn push(&mut self, message: Message) {
self.messages.push_back(message);
}
+
+ /// Check whether the message is already queued in the message bar.
+ #[inline]
+ pub fn is_queued(&self, message: &Message) -> bool {
+ self.messages.contains(message)
+ }
}
#[cfg(test)]