Skip to content

Commit

Permalink
Remove popup_border calculations from LSP Hover UI component
Browse files Browse the repository at this point in the history
The Hover component is used as the inner contents of a Popup. The Popup
should be doing calculations based on whether popup_borders is
configured and not Hover. This fixes an issue with hover rendering when
the popup border option is enabled for popups.

Fixes #12742
  • Loading branch information
the-mikedavis committed Jan 31, 2025
1 parent 28047fe commit 2367b20
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions helix-term/src/ui/lsp/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@ impl Component for Hover {

// hover content
let contents = contents.parse(Some(&cx.editor.theme));
let contents_area = area
.clip_top(if self.hovers.len() > 1 {
HEADER_HEIGHT + SEPARATOR_HEIGHT
} else {
0
})
.clip_bottom(u16::from(cx.editor.popup_border()));
let contents_area = area.clip_top(if self.hovers.len() > 1 {
HEADER_HEIGHT + SEPARATOR_HEIGHT
} else {
0
});
let contents_para = Paragraph::new(&contents)
.wrap(Wrap { trim: false })
.scroll((cx.scroll.unwrap_or_default() as u16, 0));
Expand Down

0 comments on commit 2367b20

Please sign in to comment.