@@ -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