@@ -334,12 +334,8 @@ fn debug_parameter_prompt(
334334 . to_owned ( ) ;
335335
336336 let completer = match field_type {
337- "filename" => |editor : & Editor , input : & str | {
338- ui:: completers:: filename_with_git_ignore ( editor, input, false )
339- } ,
340- "directory" => |editor : & Editor , input : & str | {
341- ui:: completers:: directory_with_git_ignore ( editor, input, false )
342- } ,
337+ "filename" => |input : & str | ui:: completers:: filename_with_git_ignore ( input, false ) ,
338+ "directory" => |input : & str | ui:: completers:: directory_with_git_ignore ( input, false ) ,
343339 _ => ui:: completers:: none,
344340 } ;
345341
@@ -631,35 +627,37 @@ pub fn dap_edit_condition(cx: &mut Context) {
631627 None => return ,
632628 } ;
633629 let callback = Box :: pin ( async move {
634- let call: Callback = Callback :: EditorCompositor ( Box :: new ( move |editor, compositor| {
635- let mut prompt = Prompt :: new (
636- "condition:" . into ( ) ,
637- None ,
638- ui:: completers:: none,
639- move |cx, input : & str , event : PromptEvent | {
640- if event != PromptEvent :: Validate {
641- return ;
642- }
643-
644- let breakpoints = & mut cx. editor . breakpoints . get_mut ( & path) . unwrap ( ) ;
645- breakpoints[ pos] . condition = match input {
646- "" => None ,
647- input => Some ( input. to_owned ( ) ) ,
648- } ;
649-
650- let debugger = debugger ! ( cx. editor) ;
651-
652- if let Err ( e) = breakpoints_changed ( debugger, path. clone ( ) , breakpoints) {
653- cx. editor
654- . set_error ( format ! ( "Failed to set breakpoints: {}" , e) ) ;
655- }
656- } ,
657- ) ;
658- if let Some ( condition) = breakpoint. condition {
659- prompt. insert_str ( & condition, editor)
660- }
661- compositor. push ( Box :: new ( prompt) ) ;
662- } ) ) ;
630+ let call: Callback =
631+ Callback :: EditorCompositor ( Box :: new ( move |_editor, compositor| {
632+ let mut prompt = Prompt :: new (
633+ "condition:" . into ( ) ,
634+ None ,
635+ ui:: completers:: none,
636+ move |cx, input : & str , event : PromptEvent | {
637+ if event != PromptEvent :: Validate {
638+ return ;
639+ }
640+
641+ let breakpoints = & mut cx. editor . breakpoints . get_mut ( & path) . unwrap ( ) ;
642+ breakpoints[ pos] . condition = match input {
643+ "" => None ,
644+ input => Some ( input. to_owned ( ) ) ,
645+ } ;
646+
647+ let debugger = debugger ! ( cx. editor) ;
648+
649+ if let Err ( e) = breakpoints_changed ( debugger, path. clone ( ) , breakpoints)
650+ {
651+ cx. editor
652+ . set_error ( format ! ( "Failed to set breakpoints: {}" , e) ) ;
653+ }
654+ } ,
655+ ) ;
656+ if let Some ( condition) = breakpoint. condition {
657+ prompt. insert_str ( & condition)
658+ }
659+ compositor. push ( Box :: new ( prompt) ) ;
660+ } ) ) ;
663661 Ok ( call)
664662 } ) ;
665663 cx. jobs . callback ( callback) ;
@@ -673,34 +671,36 @@ pub fn dap_edit_log(cx: &mut Context) {
673671 None => return ,
674672 } ;
675673 let callback = Box :: pin ( async move {
676- let call: Callback = Callback :: EditorCompositor ( Box :: new ( move |editor, compositor| {
677- let mut prompt = Prompt :: new (
678- "log-message:" . into ( ) ,
679- None ,
680- ui:: completers:: none,
681- move |cx, input : & str , event : PromptEvent | {
682- if event != PromptEvent :: Validate {
683- return ;
684- }
685-
686- let breakpoints = & mut cx. editor . breakpoints . get_mut ( & path) . unwrap ( ) ;
687- breakpoints[ pos] . log_message = match input {
688- "" => None ,
689- input => Some ( input. to_owned ( ) ) ,
690- } ;
691-
692- let debugger = debugger ! ( cx. editor) ;
693- if let Err ( e) = breakpoints_changed ( debugger, path. clone ( ) , breakpoints) {
694- cx. editor
695- . set_error ( format ! ( "Failed to set breakpoints: {}" , e) ) ;
696- }
697- } ,
698- ) ;
699- if let Some ( log_message) = breakpoint. log_message {
700- prompt. insert_str ( & log_message, editor) ;
701- }
702- compositor. push ( Box :: new ( prompt) ) ;
703- } ) ) ;
674+ let call: Callback =
675+ Callback :: EditorCompositor ( Box :: new ( move |_editor, compositor| {
676+ let mut prompt = Prompt :: new (
677+ "log-message:" . into ( ) ,
678+ None ,
679+ ui:: completers:: none,
680+ move |cx, input : & str , event : PromptEvent | {
681+ if event != PromptEvent :: Validate {
682+ return ;
683+ }
684+
685+ let breakpoints = & mut cx. editor . breakpoints . get_mut ( & path) . unwrap ( ) ;
686+ breakpoints[ pos] . log_message = match input {
687+ "" => None ,
688+ input => Some ( input. to_owned ( ) ) ,
689+ } ;
690+
691+ let debugger = debugger ! ( cx. editor) ;
692+ if let Err ( e) = breakpoints_changed ( debugger, path. clone ( ) , breakpoints)
693+ {
694+ cx. editor
695+ . set_error ( format ! ( "Failed to set breakpoints: {}" , e) ) ;
696+ }
697+ } ,
698+ ) ;
699+ if let Some ( log_message) = breakpoint. log_message {
700+ prompt. insert_str ( & log_message) ;
701+ }
702+ compositor. push ( Box :: new ( prompt) ) ;
703+ } ) ) ;
704704 Ok ( call)
705705 } ) ;
706706 cx. jobs . callback ( callback) ;
0 commit comments