buffer: Set fastdirty=true for large file when reopening

Similarly to how we force `fastdirty` to true when opening a large file
(when creating the buffer), force it also when reopening a file, in case
the file on disk became large since we opened it.
This commit is contained in:
Dmytro Maluka 2024-08-18 15:33:35 +02:00
parent d31095fe8f
commit 0b15b57e63

View File

@ -550,7 +550,11 @@ func (b *Buffer) ReOpen() error {
err = b.UpdateModTime()
if !b.Settings["fastdirty"].(bool) {
calcHash(b, &b.origHash)
if len(data) > LargeFileThreshold {
b.Settings["fastdirty"] = true
} else {
calcHash(b, &b.origHash)
}
}
b.isModified = false
b.RelocateCursors()