Skip to content

Commit

Permalink
pass reference to new config parameter of file_picker()
Browse files Browse the repository at this point in the history
  • Loading branch information
dannasessha committed Nov 7, 2021
1 parent 57a19b2 commit 8f8e9de
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn regex_prompt(
)
}

pub fn file_picker(root: PathBuf, config: helix_view::editor::Config) -> FilePicker<PathBuf> {
pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {
use ignore::{types::TypesBuilder, WalkBuilder};
use std::time;

Expand Down

0 comments on commit 8f8e9de

Please sign in to comment.