on master help sign in
ui: Restrain diagnostic sidebar w/h based on available area.
commit872d77075302a3f5b526045e07e0a5564d170e1b authorBlaž Hrastnik <blaz@mxxn.io> dateMon 15 Mar 2021, 16:25 (6 years ago) parent87e3cd3
1 file changed+5−3
helix-term/src/ui/editor.rs+5−3
helix-term/src/ui/editor.rs+5−3
@@ -362,12 +362,14 @@ impl EditorView {
362362 }
363363
364364 let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
365+ let width = 80.min(viewport.width);
366+ let height = 15.min(viewport.height);
365367 paragraph.render(
366368 Rect::new(
367− viewport.x + viewport.width - 80 - 1,
369+ viewport.right() - width,
368370 viewport.y as u16 + 1,
369− 80,
370− 15,
371+ width,
372+ height,
371373 ),
372374 surface,
373375 );