Skip to content

Commit

Permalink
Fixes #1198
Browse files Browse the repository at this point in the history
  • Loading branch information
colinkiama committed Nov 21, 2023
1 parent fdf36e7 commit fd4859e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ public class Scratch.FolderManager.FileView : Granite.Widgets.SourceList, Code.P
? item_for_path.file.file
: search_root.file.file;

search_root.global_search (start_folder, term);
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

0 comments on commit fd4859e

Please sign in to comment.