@@ -353,7 +353,7 @@ fn debug_parameter_prompt(
353 format!("{}: ", name).into(),
353 format!("{}: ", name).into(),
355 completer,
355 completer,
356− move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| {
356+ move |cx, input: &str, event: PromptEvent| {
357 if event != PromptEvent::Validate {
357 if event != PromptEvent::Validate {
@@ -634,6 +634,10 @@ pub fn dap_disable_exceptions(cx: &mut Context) {
634// we also might be editing a breakpoint in a document that's no longer focused
634// we also might be editing a breakpoint in a document that's no longer focused
635pub fn dap_edit_condition(cx: &mut Context) {
635pub fn dap_edit_condition(cx: &mut Context) {
636 if let Some((pos, breakpoint)) = commands::cmd::get_breakpoint_at_current_line(cx.editor) {
636 if let Some((pos, breakpoint)) = commands::cmd::get_breakpoint_at_current_line(cx.editor) {
637+ let path = match doc!(cx.editor).path() {
638+ Some(path) => path.clone(),
637 let callback = Box::pin(async move {
641 let callback = Box::pin(async move {
638 let call: Callback =
642 let call: Callback =
639 Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
643 Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
@@ -641,25 +645,12 @@ pub fn dap_edit_condition(cx: &mut Context) {
641 "condition:".into(),
645 "condition:".into(),
643 |_input: &str| Vec::new(),
647 |_input: &str| Vec::new(),
644− move |cx: &mut crate::compositor::Context,
646− event: PromptEvent| {
648+ move |cx, input: &str, event: PromptEvent| {
647 if event != PromptEvent::Validate {
649 if event != PromptEvent::Validate {
651− let doc = doc!(cx.editor);
652− let path = match doc.path() {
655− cx.editor.set_status(
656− "Can't edit breakpoint: document has no path".to_owned(),
662− let breakpoints = &mut cx.editor.breakpoints.get_mut(path).unwrap();
653+ let breakpoints = &mut cx.editor.breakpoints.get_mut(&path).unwrap();
663 breakpoints[pos].condition = match input {
654 breakpoints[pos].condition = match input {
664 "" => None,
655 "" => None,
665 input => Some(input.to_owned()),
656 input => Some(input.to_owned()),
@@ -711,6 +702,10 @@ pub fn dap_edit_condition(cx: &mut Context) {
712pub fn dap_edit_log(cx: &mut Context) {
703pub fn dap_edit_log(cx: &mut Context) {
713 if let Some((pos, breakpoint)) = commands::cmd::get_breakpoint_at_current_line(cx.editor) {
704 if let Some((pos, breakpoint)) = commands::cmd::get_breakpoint_at_current_line(cx.editor) {
705+ let path = match doc!(cx.editor).path() {
706+ Some(path) => path.clone(),
714 let callback = Box::pin(async move {
709 let callback = Box::pin(async move {
715 let call: Callback =
710 let call: Callback =
716 Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
711 Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
@@ -718,25 +713,12 @@ pub fn dap_edit_log(cx: &mut Context) {
718 "log-message:".into(),
713 "log-message:".into(),
720 |_input: &str| Vec::new(),
715 |_input: &str| Vec::new(),
721− move |cx: &mut crate::compositor::Context,
723− event: PromptEvent| {
716+ move |cx, input: &str, event: PromptEvent| {
724 if event != PromptEvent::Validate {
717 if event != PromptEvent::Validate {
728− let doc = doc!(cx.editor);
729− let path = match doc.path() {
732− cx.editor.set_status(
733− "Can't edit breakpoint: document has no path".to_owned(),
739− let breakpoints = &mut cx.editor.breakpoints.get_mut(path).unwrap();
721+ let breakpoints = &mut cx.editor.breakpoints.get_mut(&path).unwrap();
740 breakpoints[pos].log_message = match input {
722 breakpoints[pos].log_message = match input {
741 "" => None,
723 "" => None,
742 input => Some(input.to_owned()),
724 input => Some(input.to_owned()),