From 4d07eaa48bc4fc0c75e0346406fb6dedfc7db743 Mon Sep 17 00:00:00 2001 From: Leoi Hung Kin Date: Fri, 15 Oct 2021 16:36:39 +0800 Subject: Prevent LSP Messages from displaying when a prompt is presented (#824) * Prevent LSP Messages from displaying when a prompt is presented * use match guard--- helix-term/src/compositor.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'helix-term/src/compositor.rs') 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() -- cgit v1.2.3-70-g09d2