Skip to content

Commit

Permalink
Don't send breakpoints changed for saved event
Browse files Browse the repository at this point in the history
We send the breakpoints twice, because we already send them when the FileHandleChanged event was received and that is received after the Saved event itself. And the Saved event does not guarantee that the source is already changed on disk. Which it has to be so we can send the new breakpoints.
  • Loading branch information
RemcoSmitsDev committed Jan 19, 2025
1 parent 0a3195b commit 0d4af41
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12920,20 +12920,7 @@ impl Editor {
cx.notify();
}
multi_buffer::Event::DirtyChanged => cx.emit(EditorEvent::DirtyChanged),
multi_buffer::Event::Saved => {
cx.emit(EditorEvent::Saved);

if let Some(dap_store) = &self.dap_store {
if let Some(project_path) = self.project_path(cx) {
dap_store.update(cx, |_, cx| {
cx.emit(DapStoreEvent::BreakpointsChanged {
project_path,
source_changed: true,
});
});
}
}
}
multi_buffer::Event::Saved => cx.emit(EditorEvent::Saved),
multi_buffer::Event::FileHandleChanged => {
cx.emit(EditorEvent::TitleChanged);

Expand Down

0 comments on commit 0d4af41

Please sign in to comment.