From a97ebc2ed06ba17aab7479da517b794c30247988 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:17:31 +0000 Subject: [PATCH] style: format --- helix-term/src/ui/mod.rs | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 7f056fe4e..585898a6c 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -283,7 +283,13 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi type FileExplorer = Picker<(PathBuf, bool), (PathBuf, Style)>; -type OnConfirm = fn(cursor: u32, cx: &mut Context, picker_root: PathBuf, &str, &Path) -> Option>; +type OnConfirm = fn( + cursor: u32, + cx: &mut Context, + picker_root: PathBuf, + &str, + &Path, +) -> Option>; fn create_confirmation_prompt( cursor: u32, @@ -305,7 +311,13 @@ fn create_confirmation_prompt( return; }; - match on_confirm(cursor, cx, picker_root.clone(), &operation_input_str, &operation_input) { + match on_confirm( + cursor, + cx, + picker_root.clone(), + &operation_input_str, + &operation_input, + ) { Some(Ok(msg)) => cx.editor.set_status(msg), Some(Err(msg)) => cx.editor.set_error(msg), None => (), @@ -370,18 +382,21 @@ fn create_file_operation_prompt( fn refresh(cursor: Option, cx: &mut Context, root: PathBuf) { let callback = Box::pin(async move { - let call: Callback = - Callback::EditorCompositor(Box::new(move |editor, compositor| { - if let Ok(picker) = file_explorer(cursor, root, editor) { - compositor.push(Box::new(overlay::overlaid(picker))); - } - })); + let call: Callback = Callback::EditorCompositor(Box::new(move |editor, compositor| { + if let Ok(picker) = file_explorer(cursor, root, editor) { + compositor.push(Box::new(overlay::overlaid(picker))); + } + })); Ok(call) }); cx.jobs.callback(callback); } -pub fn file_explorer(cursor: Option, root: PathBuf, editor: &Editor) -> Result { +pub fn file_explorer( + cursor: Option, + root: PathBuf, + editor: &Editor, +) -> Result { let directory_style = editor.theme.get("ui.text.directory"); let directory_content = directory_content(&root)?;