on master help sign in
ui: Account for padding on markdown renderer.
commitf9b9bc04ccef43494cad5ea847a1426dbd38cc41 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 15 Mar 2021, 17:23 (6 years ago) parenteea3395
1 file changed+3−2
helix-term/src/ui/markdown.rs+3−2
helix-term/src/ui/markdown.rs+3−2
@@ -122,8 +122,9 @@ impl Component for Markdown {
122122
123123 fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
124124 let contents = tui::text::Text::from(self.contents.clone());
125− let width = std::cmp::min(contents.width() as u16, viewport.0);
126− let height = std::cmp::min(contents.height() as u16, viewport.1);
125+ let padding = 2;
126+ let width = std::cmp::min(contents.width() as u16 + padding, viewport.0);
127+ let height = std::cmp::min(contents.height() as u16 + padding, viewport.1);
127128 Some((width, height))
128129 }
129130}