diff options
author | Blaž Hrastnik | 2021-12-02 01:24:17 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-12-02 01:24:17 +0000 |
commit | de5e5863aa0b48a9853ea1e692cd13faea680bda (patch) | |
tree | 53b1f79f9c55bb360332a024fdba5783cad8cb4f /helix-term/src/commands | |
parent | 54f8e5c9c3c3295b7756adde504f403d36965734 (diff) |
dap: Use cursor_line over cursor + char_to_line
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r-- | helix-term/src/commands/dap.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index d009e84b..8184475c 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -164,8 +164,7 @@ fn get_breakpoint_at_current_line(editor: &mut Editor) -> Option<(usize, Breakpo let (view, doc) = current!(editor); let text = doc.text().slice(..); - let pos = doc.selection(view.id).primary().cursor(text); - let line = text.char_to_line(pos); + let line = doc.selection(view.id).primary().cursor_line(text); let path = match doc.path() { Some(path) => path, None => return None, @@ -418,8 +417,7 @@ pub fn dap_toggle_breakpoint(cx: &mut Context) { } }; let text = doc.text().slice(..); - let pos = doc.selection(view.id).primary().cursor(text); - let line = text.char_to_line(pos); + let line = doc.selection(view.id).primary().cursor_line(text); dap_toggle_breakpoint_impl(cx, path, line); } |