Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-folder-search-filtering-1198 #1379

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/FolderManager/ProjectFolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down