Skip to content

Commit 1d4c6cf

Browse files
ReloadSettings only when we need to when saving a file
1 parent 9835676 commit 1d4c6cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/buffer/save.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
326326
b.AbsPath = absFilename
327327
b.isModified = false
328328
b.UpdateModTime()
329-
b.ReloadSettings(true)
329+
330+
ft := b.FileType()
331+
b.UpdateRules()
332+
if b.FileType() != ft || newFile {
333+
b.ReloadSettings(true)
334+
}
330335

331336
err = b.Serialize()
332337
return err

0 commit comments

Comments
 (0)