From 8f8e9defd4a72093952c1dd9bfdbedb18d01a766 Mon Sep 17 00:00:00 2001 From: dannasessha Date: Sun, 7 Nov 2021 06:35:04 +0000 Subject: [PATCH] pass reference to new config parameter of file_picker() --- helix-term/src/application.rs | 2 +- helix-term/src/commands.rs | 2 +- helix-term/src/ui/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 30457c6fd9348..6c9b937fe5068 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -107,7 +107,7 @@ impl Application { if first.is_dir() { std::env::set_current_dir(&first)?; editor.new_file(Action::VerticalSplit); - compositor.push(Box::new(ui::file_picker(".".into(), config.editor.clone()))); + compositor.push(Box::new(ui::file_picker(".".into(), &config.editor))); } else { let nr_of_files = args.files.len(); editor.open(first.to_path_buf(), Action::VerticalSplit)?; diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d57acb66761a5..2a40fffbe9965 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2459,7 +2459,7 @@ fn command_mode(cx: &mut Context) { fn file_picker(cx: &mut Context) { let root = find_root(None).unwrap_or_else(|| PathBuf::from("./")); - let picker = ui::file_picker(root, cx.editor.config.clone()); + let picker = ui::file_picker(root, &cx.editor.config); cx.push_layer(Box::new(picker)); } diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 22c455064caab..faf791b3bab57 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -90,7 +90,7 @@ pub fn regex_prompt( ) } -pub fn file_picker(root: PathBuf, config: helix_view::editor::Config) -> FilePicker { +pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker { use ignore::{types::TypesBuilder, WalkBuilder}; use std::time;