diff --git a/src/FolderManager/FileView.vala b/src/FolderManager/FileView.vala index 2e3ae4a33..5b65ac266 100644 --- a/src/FolderManager/FileView.vala +++ b/src/FolderManager/FileView.vala @@ -193,7 +193,12 @@ public class Scratch.FolderManager.FileView : Granite.Widgets.SourceList, Code.P if (item_for_path != null) { var search_root = item_for_path.get_root_folder (); if (search_root is ProjectFolderItem) { - search_root.global_search (search_root.file.file, term); + GLib.File start_folder = (item_for_path is FolderItem) + ? item_for_path.file.file + : search_root.file.file; + + bool is_explicit = !(item_for_path is ProjectFolderItem); + search_root.global_search (start_folder, term, is_explicit); } } } diff --git a/src/FolderManager/ProjectFolderItem.vala b/src/FolderManager/ProjectFolderItem.vala index cc4dca33c..247b0803c 100644 --- a/src/FolderManager/ProjectFolderItem.vala +++ b/src/FolderManager/ProjectFolderItem.vala @@ -323,7 +323,11 @@ namespace Scratch.FolderManager { return is_git_repo ? monitored_repo.is_valid_new_local_branch_name (new_name) : false; } - public void global_search (GLib.File start_folder = this.file.file, string? term = null) { + public void global_search ( + GLib.File start_folder = this.file.file, + string? term = null, + bool is_explicit = false + ) { /* For now set all options to the most inclusive (except case). * The ability to set these in the dialog (or by parameter) may be added later. */ string? search_term = null; @@ -410,7 +414,7 @@ namespace Scratch.FolderManager { remove_all_badges (); collapse_all (); - if (monitored_repo != null) { + if (monitored_repo != null && !is_explicit) { try { monitored_repo.git_repo.file_status_foreach (status_options, (rel_path, status) => { var target = file.file.resolve_relative_path (rel_path);