Skip to content

Commit

Permalink
SignatureHelp: bugfix: introduce minimum width of 10
Browse files Browse the repository at this point in the history
required_size shouldn't return None. Introduce minimum width so that the
height can be calculated

Signed-off-by: Ben Fekih, Hichem <[email protected]>
  • Loading branch information
karthago1 committed Apr 19, 2024
1 parent 94405f3 commit 3577335
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions helix-term/src/ui/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ 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);
// Min width: 10, Max width: 120
let max_text_width = viewport.0.saturating_sub(PADDING).min(120).max(10);

let signature_text = crate::ui::markdown::highlighted_code_block(
sig.signature.as_str(),
Expand Down

0 comments on commit 3577335

Please sign in to comment.