mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
ReloadSettings only when we need to when saving a file (#3688)
This commit is contained in:
@@ -322,11 +322,16 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newPath := b.Path != filename
|
||||||
b.Path = filename
|
b.Path = filename
|
||||||
b.AbsPath = absFilename
|
b.AbsPath = absFilename
|
||||||
b.isModified = false
|
b.isModified = false
|
||||||
b.UpdateModTime()
|
b.UpdateModTime()
|
||||||
b.ReloadSettings(true)
|
|
||||||
|
if newPath {
|
||||||
|
// need to update glob-based and filetype-based settings
|
||||||
|
b.ReloadSettings(true)
|
||||||
|
}
|
||||||
|
|
||||||
err = b.Serialize()
|
err = b.Serialize()
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user