aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-30 02:22:26 +0000
committerBlaž Hrastnik2021-08-30 02:22:26 +0000
commit0b0b1d850a0a622dc7e74ec3937523ea1dc93fe8 (patch)
tree00e6ffc793eacb055ad2f5cc2dc917e61e3f5630
parent2c7b75475f9534ca330cccea4778a3878fed6b4c (diff)
dap: Stop comparing file paths per line number
-rw-r--r--helix-term/src/application.rs2
-rw-r--r--helix-term/src/ui/editor.rs31
2 files changed, 18 insertions, 15 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 1c30c343..53919c8a 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -1,4 +1,4 @@
-use helix_core::{merge_toml_values, syntax, Selection};
+use helix_core::{merge_toml_values, syntax};
use helix_dap::Payload;
use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
use helix_view::{theme, Editor};
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index e13eb323..725d58b3 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -452,9 +452,19 @@ impl EditorView {
if let Some(path) = doc.path() {
breakpoints = debugger.breakpoints.get(path);
+ // if we have a frame, and the frame path matches document
if let (Some(frame), Some(thread_id)) = (debugger.active_frame, debugger.thread_id)
{
- stack_frame = debugger.stack_frames[&thread_id].get(frame); // TODO: drop the clone..
+ let frame = debugger.stack_frames[&thread_id].get(frame); // TODO: drop the clone..
+ if let Some(StackFrame {
+ source: Some(source),
+ ..
+ }) = &frame
+ {
+ if source.path.as_ref() == Some(path) {
+ stack_frame = frame;
+ }
+ };
};
}
}
@@ -493,19 +503,12 @@ impl EditorView {
}
if let Some(frame) = stack_frame {
- if let Some(src) = &frame.source {
- if doc
- .path()
- .map(|path| src.path.as_ref() == Some(path))
- .unwrap_or(false)
- && frame.line - 1 == line
- {
- surface.set_style(
- Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
- helix_view::graphics::Style::default()
- .bg(helix_view::graphics::Color::LightYellow),
- );
- }
+ if frame.line - 1 == line {
+ surface.set_style(
+ Rect::new(viewport.x, viewport.y + i as u16, 6, 1),
+ helix_view::graphics::Style::default()
+ .bg(helix_view::graphics::Color::LightYellow),
+ );
}
}