diff options
Diffstat (limited to 'helix-term/src/ui/markdown.rs')
-rw-r--r-- | helix-term/src/ui/markdown.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index b7e29f21..28542cdc 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -13,7 +13,7 @@ use helix_core::{ Rope, }; use helix_view::{ - graphics::{Color, Rect, Style}, + graphics::{Color, Margin, Rect, Style}, Theme, }; @@ -207,8 +207,11 @@ impl Component for Markdown { .wrap(Wrap { trim: false }) .scroll((cx.scroll.unwrap_or_default() as u16, 0)); - let area = Rect::new(area.x + 1, area.y + 1, area.width - 2, area.height - 2); - par.render(area, surface); + let margin = Margin { + vertical: 1, + horizontal: 1, + }; + par.render(area.inner(&margin), surface); } fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { |