on master help sign in
dap: Use cursor_line over cursor + char_to_line
commitde5e5863aa0b48a9853ea1e692cd13faea680bda authorBlaž Hrastnik <blaz@mxxn.io> dateThu 2 Dec 2021, 10:24 (5 years ago) parent54f8e5c
1 file changed+2−4
helix-term/src/commands/dap.rs+2−4
helix-term/src/commands/dap.rs+2−4
@@ -164,8 +164,7 @@ fn get_breakpoint_at_current_line(editor: &mut Editor) -> Option<(usize, Breakpo
164164 let (view, doc) = current!(editor);
165165 let text = doc.text().slice(..);
166166
167− let pos = doc.selection(view.id).primary().cursor(text);
168− let line = text.char_to_line(pos);
167+ let line = doc.selection(view.id).primary().cursor_line(text);
169168 let path = match doc.path() {
170169 Some(path) => path,
171170 None => return None,
@@ -418,8 +417,7 @@ pub fn dap_toggle_breakpoint(cx: &mut Context) {
418417 }
419418 };
420419 let text = doc.text().slice(..);
421− let pos = doc.selection(view.id).primary().cursor(text);
422− let line = text.char_to_line(pos);
420+ let line = doc.selection(view.id).primary().cursor_line(text);
423421 dap_toggle_breakpoint_impl(cx, path, line);
424422}
425423