From 3b6a36f3d72cb94f3dc041afe9f26aceb2633ce8 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 5 Mar 2021 16:38:35 -0500 Subject: [PATCH] Fix comparision of terminal width and welcome message length --- src/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.rs b/src/editor.rs index 134741f..5068903 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -62,7 +62,7 @@ impl Editor { if row == height / 3 { let welcome_message = format!("Hecto editor -- version {}", VERSION); - let width = std::cmp::min(self.terminal.size() as usize, welcome_message.len()); + let width = std::cmp::min(self.terminal.size().width as usize, welcome_message.len()); println!("{}\r", &welcome_message[..width]); } else { println!("~\r");