Skip to content

Commit ed99454

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/buffer/save.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,17 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
322322
}
323323
}
324324

325+
newPath := b.Path == filename
325326
b.Path = filename
326327
b.AbsPath = absFilename
327328
b.isModified = false
328329
b.UpdateModTime()
329-
b.ReloadSettings(true)
330+
331+
ft := b.FileType()
332+
b.UpdateRules()
333+
if b.FileType() != ft || newPath {
334+
b.ReloadSettings(true)
335+
}
330336

331337
err = b.Serialize()
332338
return err

0 commit comments

Comments
 (0)