mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-05 06:30:28 +09:00
fix eofnewline not running on files with 1 rune (#1535)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user