Replace home directory before performing SaveAs
Fixes
@@ -409,9 +409,9 @@ func (b *Buffer) SaveAs(filename string) error {
}
str := b.SaveString(b.Settings["fileformat"] == "dos")
data := []byte(str)
- err := ioutil.WriteFile(filename, data, 0644)
+ err := ioutil.WriteFile(ReplaceHome(filename), data, 0644)
if err == nil {
- b.Path = ReplaceHome(filename)
+ b.Path = filename
b.IsModified = false
b.ModTime, _ = GetModTime(filename)
return b.Serialize()
