@@ -317,6 +317,7 @@ impl Command {
317317 dap_next, "Step to next",
318318 dap_variables, "List variables",
319319 dap_terminate, "End debug session",
320+ dap_edit_condition, "Edit condition of the breakpoint on the current line",
320321 dap_switch_thread, "Switch current thread",
321322 dap_switch_stack_frame, "Switch stack frame",
322323 shell_pipe, "Pipe selections through shell command",
@@ -1979,10 +1980,10 @@ mod cmd {
19791980 Ok(())
19801981 }
19811982
1982− fn get_breakpoint_at_current_line(
1983− cx: &mut compositor::Context,
1983+ pub fn get_breakpoint_at_current_line(
1984+ editor: &mut Editor,
19841985 ) -> Option<(usize, SourceBreakpoint)> {
1985− let (view, doc) = current!(cx.editor);
1986+ let (view, doc) = current!(editor);
19861987 let text = doc.text().slice(..);
19871988
19881989 let pos = doc.selection(view.id).primary().cursor(text);
@@ -1992,12 +1993,9 @@ mod cmd {
19921993 None => return None,
19931994 };
19941995 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);
19961997 let i = breakpoints.iter().position(|b| b.line == line);
1997− match i {
1998− Some(i) => Some((i, breakpoints.get(i).unwrap().clone())),
1999− None => None,
2000− }
1998+ i.map(|i| (i, breakpoints.get(i).unwrap().clone()))
20011999 }
20022000
20032001 fn edit_breakpoint_impl(
@@ -2015,7 +2013,7 @@ mod cmd {
20152013 }
20162014 };
20172015
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) {
20192017 let breakpoints = cx.editor.breakpoints.entry(path.clone()).or_default();
20202018 breakpoints.remove(pos);
20212019
@@ -2481,6 +2479,7 @@ fn command_mode(cx: &mut Context) {
24812479 .set_error(format!("no such command: '{}'", parts[0]));
24822480 };
24832481 },
2482+ None,
24842483 );
24852484 prompt.doc_fn = Box::new(|input: &str| {
24862485 let part = input.split(' ').next().unwrap_or_default();
@@ -4584,6 +4583,7 @@ fn shell_keep_pipe(cx: &mut Context) {
45844583 let index = index.unwrap_or_else(|| ranges.len() - 1);
45854584 doc.set_selection(view.id, Selection::new(ranges, index));
45864585 },
4586+ None,
45874587 );
45884588
45894589 cx.push_layer(Box::new(prompt));
@@ -4683,6 +4683,7 @@ fn shell(cx: &mut Context, prompt: Cow<'static, str>, behavior: ShellBehavior) {
46834683 doc.append_changes_to_history(view.id);
46844684 }
46854685 },
4686+ None,
46864687 );
46874688
46884689 cx.push_layer(Box::new(prompt));