diff --git a/src/tab.rs b/src/tab.rs index 3f9035b..aac6287 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -147,7 +147,7 @@ impl EditorTab { editor.with_buffer(|buffer| { for line in buffer.lines.iter() { text.push_str(line.text()); - text.push('\n'); + text.push_str(line.ending().as_str()); } }); match fs::write(path, text) {