diff --git a/src/io/file.rs b/src/io/file.rs index 655f491f7f8939a929f817563885232483f887fb..2679b95c14df3cef3668f9f928bbaca79d583d47 100644 --- a/src/io/file.rs +++ b/src/io/file.rs @@ -20,6 +20,10 @@ impl Editor { let mut con = String::new(); let _ = file.read_to_string(&mut con); + if con.is_empty() { + con.push('\n'); + } + let mut new_buffer: Buffer = SplitBuffer::from_str(&con).into(); new_buffer.title = Some(path.into());