mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-12 07:32:44 +09:00
backup: Store the file with the endings of the buffer
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user