mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00: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
1 changed files with 5 additions and 1 deletions
|
|
@ -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 a new issue