]> git.lizzy.rs Git - micro.git/commitdiff
Don't set fastdirty base if modified
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 5 Jul 2020 00:09:44 +0000 (20:09 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 5 Jul 2020 00:09:44 +0000 (20:09 -0400)
internal/buffer/settings.go

index 156d842fabf2bfc588035cdcce5a27bbbf8940e7..e04d7061ef3b0878f346c6dea63287f6d42dcb90 100644 (file)
@@ -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" {