mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-07 00:10:59 +00:00
fix eofnewline not running on files with 1 rune (#1535)
This commit is contained in:
parent
70bcf9f618
commit
25b9342fbe
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ func (b *Buffer) saveToFile(filename string, withSudo bool) error {
|
|||
|
||||
if b.Settings["eofnewline"].(bool) {
|
||||
end := b.End()
|
||||
if b.RuneAt(Loc{end.X - 1, end.Y}) != '\n' {
|
||||
if b.RuneAt(Loc{end.X, end.Y}) != '\n' {
|
||||
b.Insert(end, "\n")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue