Fix comparision of terminal width and welcome message length

This commit is contained in:
Timothy Warren 2021-03-05 16:38:35 -05:00
parent 93d3501223
commit 3b6a36f3d7

View File

@ -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");