ReloadSettings only when we need to when saving a file (#3688)

This commit is contained in:
Neko Box Coder 2025-03-12 21:06:24 +00:00 committed by GitHub
parent 7d16dcdaa6
commit 82b700390d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -322,11 +322,16 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
}
}
newPath := b.Path != filename
b.Path = filename
b.AbsPath = absFilename
b.isModified = false
b.UpdateModTime()
b.ReloadSettings(true)
if newPath {
// need to update glob-based and filetype-based settings
b.ReloadSettings(true)
}
err = b.Serialize()
return err