mirror of
https://github.com/EnumeratedDev/Typer.git
synced 2025-07-01 07:48:20 +00:00
Fix panic when saving empty file
This commit is contained in:
parent
ff087b196a
commit
8d9de7b732
@ -134,7 +134,7 @@ func (buffer *Buffer) Save() error {
|
||||
}
|
||||
|
||||
// Append new line character at end of buffer contents if not present
|
||||
if buffer.Contents[len(buffer.Contents)-1] != '\n' {
|
||||
if buffer.Contents == "" || buffer.Contents[len(buffer.Contents)-1] != '\n' {
|
||||
buffer.Contents += "\n"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user