mirror of
https://github.com/zyedidia/micro.git
synced 2024-10-27 12:37:38 +03:00
line_array insert for eofnewline and make default
Makes the `eofnewline` option enabled by default. Fixes #1525
This commit is contained in:
parent
25b9342fbe
commit
d78fe81e21
@ -112,7 +112,7 @@ func (b *Buffer) saveToFile(filename string, withSudo bool) error {
|
||||
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'})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ var defaultCommonSettings = map[string]interface{}{
|
||||
"cursorline": true,
|
||||
"diffgutter": false,
|
||||
"encoding": "utf-8",
|
||||
"eofnewline": false,
|
||||
"eofnewline": true,
|
||||
"fastdirty": false,
|
||||
"fileformat": "unix",
|
||||
"filetype": "unknown",
|
||||
|
@ -85,9 +85,10 @@ Here are the available options:
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user