Merge pull request #55 from helix-editor/autoresize
autoresize terminal in compositor render
This commit is contained in:
commit
2719a35123
|
@ -122,7 +122,9 @@ pub fn handle_event(&mut self, event: Event, cx: &mut Context) -> bool {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -138,11 +138,9 @@ pub fn resize(&mut self, area: Rect) -> io::Result<()> {
|
|||
|
||||
/// 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)?;
|
||||
}
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue