Makes the `eofnewline` option enabled by default.
Fixes #1525
if b.Settings["eofnewline"].(bool) {
end := b.End()
if b.RuneAt(Loc{end.X, end.Y}) != '\n' {
- b.Insert(end, "\n")
+ b.insert(end, []byte{'\n'})
}
}
"cursorline": true,
"diffgutter": false,
"encoding": "utf-8",
- "eofnewline": false,
+ "eofnewline": true,
"fastdirty": false,
"fileformat": "unix",
"filetype": "unknown",
default value: `utf-8`
-* `eofnewline`: micro will automatically add a newline to the file.
+* `eofnewline`: micro will automatically add a newline to the end of the
+ file if one does not exist.
- default value: `false`
+ default value: `true`
* `fastdirty`: this determines what kind of algorithm micro uses to determine
if a buffer is modified or not. When `fastdirty` is on, micro just uses a