on master help sign in
dap: Stop comparing file paths per line number
commit0b0b1d850a0a622dc7e74ec3937523ea1dc93fe8 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 30 Aug 2021, 11:22 (5 years ago) parent2c7b754
2 files changed+18−15
helix-term/src/application.rs+1−1 helix-term/src/ui/editor.rs+17−14
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};
22use helix_dap::Payload;
33use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
44use helix_view::{theme, Editor};
helix-term/src/ui/editor.rs+17−14
@@ -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