AutoSaveDelete deletes any existing autosave file
()
| 590 | |
| 591 | // AutoSaveDelete deletes any existing autosave file |
| 592 | func (tb *Buffer) AutoSaveDelete() { |
| 593 | asfn := tb.AutoSaveFilename() |
| 594 | err := os.Remove(asfn) |
| 595 | // the file may not exist, which is fine |
| 596 | if err != nil && !errors.Is(err, fs.ErrNotExist) { |
| 597 | errors.Log(err) |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | // AutoSaveCheck checks if an autosave file exists; logic for dealing with |
| 602 | // it is left to larger app; call this before opening a file. |