@@ -1440,6 +1440,7 @@ fn global_search(cx: &mut Context) {
1440 let (all_matches_sx, all_matches_rx) =
1440 let (all_matches_sx, all_matches_rx) =
1441 tokio::sync::mpsc::unbounded_channel::<(usize, PathBuf)>();
1441 tokio::sync::mpsc::unbounded_channel::<(usize, PathBuf)>();
1442 let smart_case = cx.editor.config.smart_case;
1442 let smart_case = cx.editor.config.smart_case;
1443+ let file_picker_config = cx.editor.config.file_picker.clone();
1444 let completions = search_completions(cx, None);
1445 let completions = search_completions(cx, None);
1445 let prompt = ui::regex_prompt(
1446 let prompt = ui::regex_prompt(
@@ -1468,41 +1469,55 @@ fn global_search(cx: &mut Context) {
1469 let search_root = std::env::current_dir()
1470 let search_root = std::env::current_dir()
1470 .expect("Global search error: Failed to get current dir");
1471 .expect("Global search error: Failed to get current dir");
1471− WalkBuilder::new(search_root).build_parallel().run(|| {
1472+ WalkBuilder::new(search_root)
1473+ .hidden(file_picker_config.hidden)
1474+ .parents(file_picker_config.parents)
1475+ .ignore(file_picker_config.ignore)
1476+ .git_ignore(file_picker_config.git_ignore)
1477+ .git_global(file_picker_config.git_global)
1478+ .git_exclude(file_picker_config.git_exclude)
1479+ .max_depth(file_picker_config.max_depth)
1472− let mut searcher_cl = searcher.clone();
1482+ let mut searcher_cl = searcher.clone();
1473− let matcher_cl = matcher.clone();
1483+ let matcher_cl = matcher.clone();
1474− let all_matches_sx_cl = all_matches_sx.clone();
1484+ let all_matches_sx_cl = all_matches_sx.clone();
1475− Box::new(move |dent: Result<DirEntry, ignore::Error>| -> WalkState {
1485+ Box::new(move |dent: Result<DirEntry, ignore::Error>| -> WalkState {
1476− let dent = match dent {
1486+ let dent = match dent {
1477− Ok(dent) => dent,
1487+ Ok(dent) => dent,
1478− Err(_) => return WalkState::Continue,
1488+ Err(_) => return WalkState::Continue,
1481− match dent.file_type() {
1491+ match dent.file_type() {
1482− Some(fi) => {
1492+ Some(fi) => {
1483− if !fi.is_file() {
1493+ if !fi.is_file() {
1484− return WalkState::Continue;
1494+ return WalkState::Continue;
1497+ None => return WalkState::Continue,
1487− None => return WalkState::Continue,
1490− let result_sink = sinks::UTF8(|line_num, _| {
1500+ let result_sink = sinks::UTF8(|line_num, _| {
1491− match all_matches_sx_cl
1501+ match all_matches_sx_cl
1492− .send((line_num as usize - 1, dent.path().to_path_buf()))
1502+ .send((line_num as usize - 1, dent.path().to_path_buf()))
1494− Ok(_) => Ok(true),
1504+ Ok(_) => Ok(true),
1495− Err(_) => Ok(false),
1505+ Err(_) => Ok(false),
1509+ searcher_cl.search_path(&matcher_cl, dent.path(), result_sink);
1511+ if let Err(err) = result {
1513+ "Global search error: {}, {}",
1514+ dent.path().display(),
1498− let result = searcher_cl.search_path(&matcher_cl, dent.path(), result_sink);
1500− if let Err(err) = result {
1501− log::error!("Global search error: {}, {}", dent.path().display(), err);
1503− WalkState::Continue
1518+ WalkState::Continue
1506 } else {
1521 } else {
1507 // Otherwise do nothing
1522 // Otherwise do nothing
1508 // log::warn!("Global Search Invalid Pattern")
1523 // log::warn!("Global Search Invalid Pattern")
@@ -2742,7 +2757,7 @@ fn command_mode(cx: &mut Context) {
2743fn file_picker(cx: &mut Context) {
2758fn file_picker(cx: &mut Context) {
2744 let root = find_root(None).unwrap_or_else(|| PathBuf::from("./"));
2759 let root = find_root(None).unwrap_or_else(|| PathBuf::from("./"));
2745− let picker = ui::file_picker(root);
2760+ let picker = ui::file_picker(root, &cx.editor.config);
2746 cx.push_layer(Box::new(picker));
2761 cx.push_layer(Box::new(picker));