Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | helix-term/src/ui/prompt.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 50176d58..04b785fe 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -480,17 +480,21 @@ impl Prompt { let mut text = ui::Text::new(doc.to_string()); let max_width = BASE_WIDTH * 3; - let padding = 1; + let horizontal_padding = 2; // border + margin + let vertical_padding = 1; // border only + let text_width = max_width - horizontal_padding * 2; let viewport = area; - let (_width, height) = ui::text::required_size(&text.contents, max_width); + let (_width, height) = ui::text::required_size(&text.contents, text_width); let area = viewport.intersection(Rect::new( completion_area.x, - completion_area.y.saturating_sub(height + padding * 2), + completion_area + .y + .saturating_sub(height + vertical_padding * 2), max_width, - height + padding * 2, + height + vertical_padding * 2, )); let background = theme.get("ui.help"); |