aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hrastnik2021-06-02 13:40:08 +0000
committerJan Hrastnik2021-06-02 13:40:08 +0000
commit78980f575be1cbb31f1bdab92d3ecd2be4d2adac (patch)
tree7c6fc677061b0aa7a47661ce610487df8dd99409
parentc2e6b9f506fddec15e48bd06cf712aef2bf53e3c (diff)
autoresize terminal in compositor render
-rw-r--r--helix-term/src/compositor.rs2
-rw-r--r--helix-tui/src/terminal.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 3a17904d..7753e0a5 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -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 {
diff --git a/helix-tui/src/terminal.rs b/helix-tui/src/terminal.rs
index 7346d66d..1a0cae3e 100644
--- a/helix-tui/src/terminal.rs
+++ b/helix-tui/src/terminal.rs
@@ -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(())
}