From 1900d438c59cb3d5da56e3d580565a10b940faba Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 23 Apr 2024 16:31:14 +0200 Subject: [PATCH] fix required_size implementation of signature help Trunctation should always be handled by the parent. Returning None is only supposed to indicate a missing implementation Co-authored-by: Ben Fekih, Hichem" --- helix-term/src/ui/lsp.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/helix-term/src/ui/lsp.rs b/helix-term/src/ui/lsp.rs index d53437ecdebe..b82f7be294ff 100644 --- a/helix-term/src/ui/lsp.rs +++ b/helix-term/src/ui/lsp.rs @@ -155,10 +155,7 @@ impl Component for SignatureHelp { let sig = &self.signatures[self.active_signature]; - if PADDING >= viewport.1 || PADDING >= viewport.0 { - return None; - } - let max_text_width = (viewport.0 - PADDING).min(120); + let max_text_width = viewport.0.saturating_sub(PADDING).clamp(10, 120); let signature_text = crate::ui::markdown::highlighted_code_block( sig.signature.as_str(),