Skip to content
Open
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
9 changes: 6 additions & 3 deletions src/FolderManager/ProjectFolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ namespace Scratch.FolderManager {
var wholeword_search = Scratch.settings.get_boolean ("wholeword-search");
var case_mode = (CaseSensitiveMode)(Scratch.settings.get_enum ("case-sensitive-search"));
var use_regex = Scratch.settings.get_boolean ("regex-search");

switch (case_mode) {
case NEVER:
case_sensitive = false;
Expand Down Expand Up @@ -568,13 +569,18 @@ namespace Scratch.FolderManager {
dialog.run ();

if (search_term != null) {
// Remove results of previous search before attempting a new one
remove_all_badges ();
collapse_all ();

/* Put search term in search bar to help user locate the position of the matches in each doc */
var search_variant = new Variant.string (search_term);
var app = (Gtk.Application)GLib.Application.get_default ();
var win = (Scratch.MainWindow)(app.get_active_window ());
win.actions.lookup_action ("action-find").activate (search_variant);

if (!use_regex) {
search_term = Regex.escape_string (search_term);
if (wholeword_search) {
search_term = "\\b%s\\b".printf (search_term);
}
Expand Down Expand Up @@ -608,9 +614,6 @@ namespace Scratch.FolderManager {
path_spec
);

remove_all_badges ();
collapse_all ();

if (monitored_repo != null && !is_explicit) {
try {
monitored_repo.git_repo.file_status_foreach (status_options, (rel_path, status) => {
Expand Down