Fix race-condition in autosave (#39409)
This removes a long-standing thing we've done, which is send a `DidSave` notification to the language server for the clean parts of a multi-buffer. However, it seems like the intent of that notification is to tell the language server to reload the file from disk. As we didn't actually write those files to disk, it seems clearer to not send this notification; and just remove this whole code-path. Release Notes: - Fixed a race where autosave in a multibuffer could cause unsaved buffers to appear saved
This commit is contained in:
@@ -1312,9 +1312,8 @@ impl Buffer {
|
||||
mtime: Option<MTime>,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.saved_version = version;
|
||||
self.has_unsaved_edits
|
||||
.set((self.saved_version().clone(), false));
|
||||
self.saved_version = version.clone();
|
||||
self.has_unsaved_edits.set((version, false));
|
||||
self.has_conflict = false;
|
||||
self.saved_mtime = mtime;
|
||||
self.was_changed();
|
||||
|
||||
Reference in New Issue
Block a user