Skip to content

Commit e02848f

Browse files
committed
buffer: Don't Serialize in case the buffer is shared
Otherwise we unnecessarily serialize the shared buffer every time when closing a bufpane with this buffer, so every such serialize overwrites the previous one, thus only the last serialize (when closing the last instance of the buffer, i.e. when actually closing the file, i.e. when the buffer is not shared anymore) will be used anyway.
1 parent ea59a85 commit e02848f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/buffer/buffer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,10 @@ func (b *Buffer) Close() {
531531
// Fini should be called when a buffer is closed and performs
532532
// some cleanup
533533
func (b *Buffer) Fini() {
534-
if !b.Modified() {
535-
b.Serialize()
536-
}
537534
if !b.Shared() {
535+
if !b.Modified() {
536+
b.Serialize()
537+
}
538538
b.CancelBackup()
539539
}
540540

0 commit comments

Comments
 (0)