diff options
author | Dmitry Sharshakov | 2021-09-05 05:14:17 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-09-05 05:14:17 +0000 |
commit | 3b0ec750ff7348c60a60164ca54237c5b4acd694 (patch) | |
tree | 0a2e9884025a3d1fb80ad3921567dfd4c402d10c /helix-term/src/ui | |
parent | 1befbd076c0d182d7b6d9a6198054551d5ba34da (diff) |
Support editing breakpoint condition with right click
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 4681f400..20fdd152 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1074,6 +1074,31 @@ impl EditorView { } MouseEvent { + kind: MouseEventKind::Up(MouseButton::Right), + row, + column, + .. + } => { + 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)) + }); + + if let Some((line, _, view_id)) = result { + cxt.editor.tree.focus = view_id; + + let doc = &mut cxt.editor.documents[cxt.editor.tree.get(view_id).doc]; + if let Ok(pos) = doc.text().try_line_to_char(line) { + doc.set_selection(view_id, Selection::point(pos)); + commands::Command::dap_edit_condition.execute(cxt); + + return EventResult::Consumed(None); + } + } + EventResult::Ignored + } + + MouseEvent { kind: MouseEventKind::Up(MouseButton::Middle), row, column, |