Add option to clean unused settings and other parts of config

This commit is contained in:
Zachary Yedidia
2020-02-02 15:30:06 -05:00
parent dba8ef2fdd
commit 6a1b8f4a4f
4 changed files with 166 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"io"
"os"
"path/filepath"
"time"
"golang.org/x/text/encoding"
@@ -49,7 +50,7 @@ func (b *Buffer) Unserialize() error {
if b.Path == "" {
return nil
}
file, err := os.Open(config.ConfigDir + "/buffers/" + util.EscapePath(b.AbsPath))
file, err := os.Open(filepath.Join(config.ConfigDir, "buffers", util.EscapePath(b.AbsPath)))
defer file.Close()
if err == nil {
var buffer SerializedBuffer