Skip to content

Commit

Permalink
fix required_size implementation of hover
Browse files Browse the repository at this point in the history
Co-authored-by: Vladyslav Karasov <36513243+cotneit@users.noreply.github.com>
  • Loading branch information
kyfanc and cotneit authored Aug 27, 2024
1 parent a5f9ca8 commit 42555c3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions helix-term/src/ui/lsp/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ impl Component for Hover {
}

fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
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 (Some(header), Some(contents)) = (self.header.as_ref(), self.contents.as_ref()) else {
log::info!("markdown not ready");
Expand Down

0 comments on commit 42555c3

Please sign in to comment.