aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-24 18:28:51 +0000
committerDmitry Sharshakov2021-08-24 18:28:51 +0000
commit2c3e2b979b8b2fb501cb0c6b7123d9091266efdc (patch)
tree5daa178fe5adc5dd9bdd6d44ed03e9a3c3e8cb2f /helix-term
parent8cc6d68160e952004c84f88a2d9726b4e2d649fa (diff)
Workaround for debugging Go tests
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 3f911195..17c762da 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -273,11 +273,14 @@ impl Application {
..
}) => {
debugger.is_running = false;
- let main = debugger
- .threads()
- .await
- .ok()
- .and_then(|threads| threads.get(0).cloned());
+ let main = debugger.threads().await.ok().and_then(|threads| {
+ // Workaround for debugging Go tests. Main thread has * in beginning of its name
+ let mut main = threads.iter().find(|t| t.name.starts_with('*')).cloned();
+ if main.is_none() {
+ main = threads.get(0).cloned();
+ }
+ main
+ });
if let Some(main) = main {
let (bt, _) = debugger.stack_trace(main.id).await.unwrap();