From cf86f6848f8ec9e53c5e9f2850762451b054460f Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 4 Jul 2020 20:09:44 -0400 Subject: [PATCH] Don't set fastdirty base if modified --- internal/buffer/settings.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/buffer/settings.go b/internal/buffer/settings.go index 156d842f..e04d7061 100644 --- a/internal/buffer/settings.go +++ b/internal/buffer/settings.go @@ -10,9 +10,11 @@ func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error { if option == "fastdirty" { if !nativeValue.(bool) { - e := calcHash(b, &b.origHash) - if e == ErrFileTooLarge { - b.Settings["fastdirty"] = false + if !b.Modified() { + e := calcHash(b, &b.origHash) + if e == ErrFileTooLarge { + b.Settings["fastdirty"] = false + } } } } else if option == "statusline" {