diff options
author | Ivan Tham | 2022-10-03 14:56:24 +0000 |
---|---|---|
committer | GitHub | 2022-10-03 14:56:24 +0000 |
commit | 93f26a3048606704c6c16c80a0090fbae64eaf80 (patch) | |
tree | 92a4deda0fe9a2092869ae8b422026575784c789 | |
parent | 63ff9309cee6c5a8b361f2e56f0f69228aa1f1b3 (diff) |
Fix signature help panic when too large (#4030)
When signature help is too large it may cause a panic when it is too
large, now I just make the hover do an intersection with surface to make
sure it never overflow.
-rw-r--r-- | helix-term/src/ui/lsp.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/lsp.rs b/helix-term/src/ui/lsp.rs index f2854551..393d24c4 100644 --- a/helix-term/src/ui/lsp.rs +++ b/helix-term/src/ui/lsp.rs @@ -68,8 +68,9 @@ impl Component for SignatureHelp { let (_, sig_text_height) = crate::ui::text::required_size(&sig_text, area.width); let sig_text_area = area.clip_top(1).with_height(sig_text_height); + let sig_text_area = sig_text_area.inner(&margin).intersection(surface.area); let sig_text_para = Paragraph::new(sig_text).wrap(Wrap { trim: false }); - sig_text_para.render(sig_text_area.inner(&margin), surface); + sig_text_para.render(sig_text_area, surface); if self.signature_doc.is_none() { return; |