on master help sign in
dap: Stop comparing file paths per line number
0b0b1d8Blaž Hrastnik
helix-term/src/application.rs+1−1
@@ -1,4 +1,4 @@
1−use helix_core::{merge_toml_values, syntax, Selection};
1+use helix_core::{merge_toml_values, syntax};
2use helix_dap::Payload;
2use helix_dap::Payload;
3use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
3use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
4use helix_view::{theme, Editor};
4use helix_view::{theme, Editor};
helix-term/src/ui/editor.rs+17−14
@@ -452,9 +452,19 @@ impl EditorView {
452 if let Some(path) = doc.path() {
452 if let Some(path) = doc.path() {
453 breakpoints = debugger.breakpoints.get(path);
453 breakpoints = debugger.breakpoints.get(path);
454
454
455+ // if we have a frame, and the frame path matches document
455 if let (Some(frame), Some(thread_id)) = (debugger.active_frame, debugger.thread_id)
456 if let (Some(frame), Some(thread_id)) = (debugger.active_frame, debugger.thread_id)
456 {
457 {
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+ };
458 };
468 };
459 }
469 }
460 }
470 }
@@ -493,19 +503,12 @@ impl EditorView {
493 }
503 }
494
504
495 if let Some(frame) = stack_frame {
505 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
506+ if frame.line - 1 == line {
502− {
503− surface.set_style(
507+ surface.set_style(
504− Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
508+ Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
505− helix_view::graphics::Style::default()
509+ helix_view::graphics::Style::default()
506− .bg(helix_view::graphics::Color::LightYellow),
510+ .bg(helix_view::graphics::Color::LightYellow),
507− );
511+ );
508− }
509 }
512 }
510 }
513 }
511
514