@@ -452,9 +452,19 @@ impl EditorView {
452452 if let Some(path) = doc.path() {
453453 breakpoints = debugger.breakpoints.get(path);
454454
455+ // if we have a frame, and the frame path matches document
455456 if let (Some(frame), Some(thread_id)) = (debugger.active_frame, debugger.thread_id)
456457 {
457− stack_frame = debugger.stack_frames[&thread_id].get(frame); // TODO: drop the clone..
458+ let frame = debugger.stack_frames[&thread_id].get(frame); // TODO: drop the clone..
459+ if let Some(StackFrame {
460+ source: Some(source),
461+ ..
462+ }) = &frame
463+ {
464+ if source.path.as_ref() == Some(path) {
465+ stack_frame = frame;
466+ }
467+ };
458468 };
459469 }
460470 }
@@ -493,19 +503,12 @@ impl EditorView {
493503 }
494504
495505 if let Some(frame) = stack_frame {
496− if let Some(src) = &frame.source {
497− if doc
498− .path()
499− .map(|path| src.path.as_ref() == Some(path))
500− .unwrap_or(false)
501− && frame.line - 1 == line
502− {
503− surface.set_style(
504− Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
505− helix_view::graphics::Style::default()
506− .bg(helix_view::graphics::Color::LightYellow),
507− );
508− }
506+ if frame.line - 1 == line {
507+ surface.set_style(
508+ Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
509+ helix_view::graphics::Style::default()
510+ .bg(helix_view::graphics::Color::LightYellow),
511+ );
509512 }
510513 }
511514