Only send UpdateBufferFile messages for buffers whose files have changed

Send that message when saving a buffer as a new path.
This commit is contained in:
Max Brunsfeld 2023-02-20 09:33:02 -08:00
parent cdf64b6cad
commit 56b7eb6b6f
4 changed files with 43 additions and 36 deletions

View file

@ -549,16 +549,11 @@ impl Buffer {
version: clock::Global,
fingerprint: RopeFingerprint,
mtime: SystemTime,
new_file: Option<Arc<dyn File>>,
cx: &mut ModelContext<Self>,
) {
self.saved_version = version;
self.saved_version_fingerprint = fingerprint;
self.saved_mtime = mtime;
if let Some(new_file) = new_file {
self.file = Some(new_file);
self.file_update_count += 1;
}
cx.emit(Event::Saved);
cx.notify();
}