@@ -317,6 +317,7 @@ impl Command {
317 dap_next, "Step to next",
317 dap_next, "Step to next",
318 dap_variables, "List variables",
318 dap_variables, "List variables",
319 dap_terminate, "End debug session",
319 dap_terminate, "End debug session",
320+ dap_edit_condition, "Edit condition of the breakpoint on the current line",
320 dap_switch_thread, "Switch current thread",
321 dap_switch_thread, "Switch current thread",
321 dap_switch_stack_frame, "Switch stack frame",
322 dap_switch_stack_frame, "Switch stack frame",
322 shell_pipe, "Pipe selections through shell command",
323 shell_pipe, "Pipe selections through shell command",
@@ -1979,10 +1980,10 @@ mod cmd {
1982− fn get_breakpoint_at_current_line(
1983+ pub fn get_breakpoint_at_current_line(
1983− cx: &mut compositor::Context,
1984+ editor: &mut Editor,
1984 ) -> Option<(usize, SourceBreakpoint)> {
1985 ) -> Option<(usize, SourceBreakpoint)> {
1985− let (view, doc) = current!(cx.editor);
1986+ let (view, doc) = current!(editor);
1986 let text = doc.text().slice(..);
1987 let text = doc.text().slice(..);
1988 let pos = doc.selection(view.id).primary().cursor(text);
1989 let pos = doc.selection(view.id).primary().cursor(text);
@@ -1992,12 +1993,9 @@ mod cmd {
1992 None => return None,
1993 None => return None,
1994 let vec = vec![];
1995 let vec = vec![];
1995− let breakpoints = cx.editor.breakpoints.get(&path.clone()).unwrap_or(&vec);
1996+ let breakpoints = editor.breakpoints.get(&path).unwrap_or(&vec);
1996 let i = breakpoints.iter().position(|b| b.line == line);
1997 let i = breakpoints.iter().position(|b| b.line == line);
1998− Some(i) => Some((i, breakpoints.get(i).unwrap().clone())),
1998+ i.map(|i| (i, breakpoints.get(i).unwrap().clone()))
2003 fn edit_breakpoint_impl(
2001 fn edit_breakpoint_impl(
@@ -2015,7 +2013,7 @@ mod cmd {
2018− if let Some((pos, mut bp)) = get_breakpoint_at_current_line(cx) {
2016+ if let Some((pos, mut bp)) = get_breakpoint_at_current_line(cx.editor) {
2019 let breakpoints = cx.editor.breakpoints.entry(path.clone()).or_default();
2017 let breakpoints = cx.editor.breakpoints.entry(path.clone()).or_default();
2020 breakpoints.remove(pos);
2018 breakpoints.remove(pos);
@@ -2481,6 +2479,7 @@ fn command_mode(cx: &mut Context) {
2481 .set_error(format!("no such command: '{}'", parts[0]));
2479 .set_error(format!("no such command: '{}'", parts[0]));
2485 prompt.doc_fn = Box::new(|input: &str| {
2484 prompt.doc_fn = Box::new(|input: &str| {
2486 let part = input.split(' ').next().unwrap_or_default();
2485 let part = input.split(' ').next().unwrap_or_default();
@@ -4584,6 +4583,7 @@ fn shell_keep_pipe(cx: &mut Context) {
4584 let index = index.unwrap_or_else(|| ranges.len() - 1);
4583 let index = index.unwrap_or_else(|| ranges.len() - 1);
4585 doc.set_selection(view.id, Selection::new(ranges, index));
4584 doc.set_selection(view.id, Selection::new(ranges, index));
4589 cx.push_layer(Box::new(prompt));
4589 cx.push_layer(Box::new(prompt));
@@ -4683,6 +4683,7 @@ fn shell(cx: &mut Context, prompt: Cow<'static, str>, behavior: ShellBehavior) {
4683 doc.append_changes_to_history(view.id);
4683 doc.append_changes_to_history(view.id);
4688 cx.push_layer(Box::new(prompt));
4689 cx.push_layer(Box::new(prompt));