Serialize breakpoints when changing the state of a breakpoint (#27373)
This fixes a rare bug where a breakpoint isn't saved in the database when a user toggles a breakpoint and immediately exits out of zed. Release Notes: - N/A Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
This commit is contained in:
parent
a23e293ca2
commit
350c1e41d2
1 changed files with 13 additions and 1 deletions
|
@ -65,7 +65,8 @@ use persistence::{
|
|||
};
|
||||
use postage::stream::Stream;
|
||||
use project::{
|
||||
DirectoryLister, Project, ProjectEntryId, ProjectPath, ResolvedPath, Worktree, WorktreeId,
|
||||
debugger::breakpoint_store::BreakpointStoreEvent, DirectoryLister, Project, ProjectEntryId,
|
||||
ProjectPath, ResolvedPath, Worktree, WorktreeId,
|
||||
};
|
||||
use remote::{ssh_session::ConnectionIdentifier, SshClientDelegate, SshConnectionOptions};
|
||||
use schemars::JsonSchema;
|
||||
|
@ -974,6 +975,17 @@ impl Workspace {
|
|||
})
|
||||
.detach();
|
||||
|
||||
cx.subscribe_in(
|
||||
&project.read(cx).breakpoint_store(),
|
||||
window,
|
||||
|workspace, _, evt, window, cx| {
|
||||
if let BreakpointStoreEvent::BreakpointsUpdated(_, _) = evt {
|
||||
workspace.serialize_workspace(window, cx);
|
||||
}
|
||||
},
|
||||
)
|
||||
.detach();
|
||||
|
||||
cx.on_focus_lost(window, |this, window, cx| {
|
||||
let focus_handle = this.focus_handle(cx);
|
||||
window.focus(&focus_handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue