diff options
author | Blaž Hrastnik | 2021-03-15 08:23:42 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-15 08:23:42 +0000 |
commit | f9b9bc04ccef43494cad5ea847a1426dbd38cc41 (patch) | |
tree | 2291df8babb9c4ca5eec39814373c5d9293d47b1 /helix-term/src/ui | |
parent | eea339545cf7198b7a9e477ee2a9ee081ee5be36 (diff) |
ui: Account for padding on markdown renderer.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/markdown.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 3040e1ca..c503d2c0 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -122,8 +122,9 @@ impl Component for Markdown { fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { let contents = tui::text::Text::from(self.contents.clone()); - let width = std::cmp::min(contents.width() as u16, viewport.0); - let height = std::cmp::min(contents.height() as u16, viewport.1); + let padding = 2; + let width = std::cmp::min(contents.width() as u16 + padding, viewport.0); + let height = std::cmp::min(contents.height() as u16 + padding, viewport.1); Some((width, height)) } } |