From fae93aa30825092f9b8513a9139c9f91cff3bbb8 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:02:10 +0000 Subject: [PATCH] refactor: move statement elsewhere --- helix-term/src/ui/mod.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index ce74570b..0761034c 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -413,18 +413,6 @@ pub fn file_explorer( let directory_style = editor.theme.get("ui.text.directory"); let directory_content = directory_content(&root)?; - let columns = [PickerColumn::new( - "path", - |(path, is_dir): &(PathBuf, bool), (root, directory_style): &(PathBuf, Style)| { - let name = path.strip_prefix(root).unwrap_or(path).to_string_lossy(); - if *is_dir { - Span::styled(format!("{}/", name), *directory_style).into() - } else { - name.into() - } - }, - )]; - let yank_path: KeyHandler = Box::new(|cx, (path, _), _, _| { let register = cx .editor @@ -664,6 +652,18 @@ pub fn file_explorer( ) }); + let columns = [PickerColumn::new( + "path", + |(path, is_dir): &(PathBuf, bool), (root, directory_style): &(PathBuf, Style)| { + let name = path.strip_prefix(root).unwrap_or(path).to_string_lossy(); + if *is_dir { + Span::styled(format!("{}/", name), *directory_style).into() + } else { + name.into() + } + }, + )]; + let picker = Picker::new( columns, 0,