on master help sign in
ui: Restrain diagnostic sidebar w/h based on available area.
872d770Blaž Hrastnik
helix-term/src/ui/editor.rs+5−3
@@ -362,12 +362,14 @@ impl EditorView {
362 }
362 }
363
363
364 let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
364 let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
365+ let width = 80.min(viewport.width);
366+ let height = 15.min(viewport.height);
365 paragraph.render(
367 paragraph.render(
366 Rect::new(
368 Rect::new(
367− viewport.x + viewport.width - 80 - 1,
369+ viewport.right() - width,
368 viewport.y as u16 + 1,
370 viewport.y as u16 + 1,
369− 80,
371+ width,
370− 15,
372+ height,
371 ),
373 ),
372 surface,
374 surface,
373 );
375 );