aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-21 17:38:03 +0000
committerDmitry Sharshakov2021-08-21 17:38:03 +0000
commit6709b4242f5e052ea0c18de3b2211c04b26dc865 (patch)
tree8d342e8669e4590abab27903e92e5e13875854c2 /helix-term
parent26dee49dc991d671fc3cbf7993ff193859edea4e (diff)
Drop and terminate debugger
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs3
-rw-r--r--helix-term/src/commands.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index ec92a5d4..d65610ef 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -187,6 +187,9 @@ impl Application {
}
}
Some(payload) = self.editor.debugger_events.next() => {
+ if self.editor.debugger.is_none() {
+ continue;
+ }
let mut debugger = self.editor.debugger.as_mut().unwrap();
match payload {
Payload::Event(ev) => {
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index f7317f7a..de1b9890 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -4329,5 +4329,6 @@ fn dap_terminate(cx: &mut Context) {
if let Some(debugger) = &mut cx.editor.debugger {
let request = debugger.disconnect();
let _ = block_on(request).unwrap();
+ cx.editor.debugger = None;
}
}