Fix comparision of terminal width and welcome message length
This commit is contained in:
parent
93d3501223
commit
3b6a36f3d7
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user