mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
ui: Restrain diagnostic sidebar w/h based on available area.
This commit is contained in:
parent
87e3cd3df2
commit
872d770753
@ -362,12 +362,14 @@ pub fn render_diagnostics(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
|
let paragraph = Paragraph::new(lines).alignment(Alignment::Right);
|
||||||
|
let width = 80.min(viewport.width);
|
||||||
|
let height = 15.min(viewport.height);
|
||||||
paragraph.render(
|
paragraph.render(
|
||||||
Rect::new(
|
Rect::new(
|
||||||
viewport.x + viewport.width - 80 - 1,
|
viewport.right() - width,
|
||||||
viewport.y as u16 + 1,
|
viewport.y as u16 + 1,
|
||||||
80,
|
width,
|
||||||
15,
|
height,
|
||||||
),
|
),
|
||||||
surface,
|
surface,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user