mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-10-31 11:31:48 +00:00
Fix panic when saving empty file
This commit is contained in:
1 parent
ff087b196a
commit
8d9de7b732
1 file changed
+1
-1
+1
-1
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user