From 7121469cba73fdaebc35ca44649d0c8eb0589202 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Mon, 1 Jan 2018 13:38:51 -0800 Subject: [PATCH] Termninal size information wasn't being set properly at startup. --- src/term_ui/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/term_ui/mod.rs b/src/term_ui/mod.rs index 34a96b6..8c5a16d 100644 --- a/src/term_ui/mod.rs +++ b/src/term_ui/mod.rs @@ -120,9 +120,16 @@ impl TermUI { // Hide cursor self.screen.hide_cursor(); + // Set terminal size info + let (w, h) = termion::terminal_size().unwrap(); + self.width = w as usize; + self.height = h as usize; self.editor.update_dim(self.height - 1, self.width); - self.editor.formatter.set_wrap_width(self.width as usize); + self.editor.update_view_dim(); + self.editor.formatter.set_wrap_width(self.editor.view_dim.1); + self.screen.resize(w as usize, h as usize); + // Start the UI ui_loop!( self,