Blob Blame History Raw
From 4d7a1a7413cc7e76e99e11def90a6503cc142efb Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 26 Feb 2020 12:56:39 +0100
Subject: [PATCH] files-view: Clear selection if any files don't match the
 pattern

The Select items matching (Ctrl + S) feature allows to select files
which match the pattern. However, it is confusing that current selection
is not cleared when any files don't match the pattern.
---
 src/nautilus-files-view.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 5573701cc..f3d507fff 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1716,12 +1716,12 @@ pattern_select_response_cb (GtkWidget *dialog,
             selection = nautilus_directory_match_pattern (directory,
                                                           gtk_entry_get_text (GTK_ENTRY (entry)));
 
+            nautilus_files_view_call_set_selection (view, selection);
+            nautilus_files_view_reveal_selection (view);
+
             if (selection)
             {
-                nautilus_files_view_call_set_selection (view, selection);
                 nautilus_file_list_free (selection);
-
-                nautilus_files_view_reveal_selection (view);
             }
             /* fall through */
         }
-- 
2.26.0