From 93e8c16614b26278a1a979a3a01a46c9ba3d681f 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 d53437ecd..b82f7be29 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(),