summaryrefslogtreecommitdiff
path: root/helix-term/src/compositor.rs
diff options
context:
space:
mode:
authorLeoi Hung Kin2021-10-15 08:36:39 +0000
committerGitHub2021-10-15 08:36:39 +0000
commit4d07eaa48bc4fc0c75e0346406fb6dedfc7db743 (patch)
treec287cb1d6890865bfd3954aeeeb227c9da7d7550 /helix-term/src/compositor.rs
parentef3f78b6ce79ab17d85780ec02af12ed1459b971 (diff)
Prevent LSP Messages from displaying when a prompt is presented (#824)
* Prevent LSP Messages from displaying when a prompt is presented * use match guard
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 36e54ede..cad1df05 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -171,6 +171,12 @@ impl Compositor {
(None, CursorKind::Hidden)
}
+ pub fn has_component(&self, type_name: &str) -> bool {
+ self.layers
+ .iter()
+ .any(|component| component.type_name() == type_name)
+ }
+
pub fn find(&mut self, type_name: &str) -> Option<&mut dyn Component> {
self.layers
.iter_mut()