Skip to content
Snippets Groups Projects
Commit fcae711a authored by Jeremy Soller's avatar Jeremy Soller
Browse files

When opening an empty file, always have at least one line of text

parent 1203a62d
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,10 @@ impl Editor { ...@@ -20,6 +20,10 @@ impl Editor {
let mut con = String::new(); let mut con = String::new();
let _ = file.read_to_string(&mut con); let _ = file.read_to_string(&mut con);
if con.is_empty() {
con.push('\n');
}
let mut new_buffer: Buffer = SplitBuffer::from_str(&con).into(); let mut new_buffer: Buffer = SplitBuffer::from_str(&con).into();
new_buffer.title = Some(path.into()); new_buffer.title = Some(path.into());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment