mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-05 07:21:00 +00:00
backup: Store the file with the endings of the buffer
This commit is contained in:
parent
7c659d1820
commit
0b871e174f
1 changed files with 6 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue