mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
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:
parent
d31095fe8f
commit
0b15b57e63
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user