autoresize terminal in compositor render

This commit is contained in:
Jan Hrastnik 2021-06-02 15:40:08 +02:00
parent c2e6b9f506
commit 78980f575b
2 changed files with 5 additions and 5 deletions

View file

@ -122,7 +122,9 @@ impl Compositor {
}
pub fn render(&mut self, cx: &mut Context) {
self.terminal.autoresize().unwrap();
let area = self.size();
let surface = self.terminal.current_buffer_mut();
for layer in &self.layers {

View file

@ -138,11 +138,9 @@ where
/// Queries the backend for size and resizes if it doesn't match the previous size.
pub fn autoresize(&mut self) -> io::Result<()> {
if self.viewport.resize_behavior == ResizeBehavior::Auto {
let size = self.size()?;
if size != self.viewport.area {
self.resize(size)?;
}
let size = self.size()?;
if size != self.viewport.area {
self.resize(size)?;
};
Ok(())
}