diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index fe4e3439a..af1d8af82 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -362,12 +362,14 @@ pub fn render_diagnostics( } let paragraph = Paragraph::new(lines).alignment(Alignment::Right); + let width = 80.min(viewport.width); + let height = 15.min(viewport.height); paragraph.render( Rect::new( - viewport.x + viewport.width - 80 - 1, + viewport.right() - width, viewport.y as u16 + 1, - 80, - 15, + width, + height, ), surface, );