diff options
author | Blaž Hrastnik | 2021-11-22 02:09:09 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-11-22 02:09:09 +0000 |
commit | 5f329a22c48ebf586da12323b6e1f45e9d78fdc1 (patch) | |
tree | 120fe74b4c53b6631f54c7235a40b9f33381c384 /helix-term/src/ui | |
parent | 3b3c396ca4da14b2df8ffd3f9ef3abede3c72a4e (diff) |
dap: Modify breakpoints in place with no cloning
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 01554c64..19f0243e 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -978,17 +978,17 @@ impl EditorView { let result = editor.tree.views().find_map(|(view, _focus)| { view.gutter_coords_at_screen_coords(row, column) - .map(|coords| (coords.0, coords.1, view.id)) + .map(|coords| (coords, view.id)) }); - if let Some((line, _, view_id)) = result { + if let Some((coords, view_id)) = result { editor.tree.focus = view_id; let doc = editor .documents .get_mut(&editor.tree.get(view_id).doc) .unwrap(); - if let Ok(pos) = doc.text().try_line_to_char(line) { + if let Ok(pos) = doc.text().try_line_to_char(coords.row) { doc.set_selection(view_id, Selection::point(pos)); commands::dap_toggle_breakpoint(cxt); @@ -1080,10 +1080,10 @@ impl EditorView { } => { let result = cxt.editor.tree.views().find_map(|(view, _focus)| { view.gutter_coords_at_screen_coords(row, column) - .map(|coords| (coords.0, coords.1, view.id)) + .map(|coords| (coords, view.id)) }); - if let Some((line, _, view_id)) = result { + if let Some((coords, view_id)) = result { cxt.editor.tree.focus = view_id; let doc = cxt @@ -1091,7 +1091,7 @@ impl EditorView { .documents .get_mut(&cxt.editor.tree.get(view_id).doc) .unwrap(); - if let Ok(pos) = doc.text().try_line_to_char(line) { + if let Ok(pos) = doc.text().try_line_to_char(coords.row) { doc.set_selection(view_id, Selection::point(pos)); if modifiers == crossterm::event::KeyModifiers::ALT { commands::Command::dap_edit_log.execute(cxt); |