backup: Store the file with the endings of the buffer

This commit is contained in:
Jöran Karl
2024-05-23 23:18:56 +02:00
parent 7c659d1820
commit 0b871e174f

View File

@@ -87,7 +87,12 @@ func (b *Buffer) Backup() error {
}
// end of line
eol := []byte{'\n'}
var eol []byte
if b.Endings == FFDos {
eol = []byte{'\r', '\n'}
} else {
eol = []byte{'\n'}
}
// write lines
if _, e = file.Write(b.lines[0].data); e != nil {