change to exclude sub-directories too from index search

This commit is contained in:
Jeremy Wu 2020-06-03 20:15:21 +10:00
parent 2c15f1ce70
commit 06877ca06b
3 changed files with 5 additions and 5 deletions

View file

@ -192,8 +192,8 @@ namespace Flow.Launcher.Plugin.Explorer
SubTitle = "Path: " + record.FullPath,
Action = _ =>
{
if(!Main.Settings.IndexSearchExcludedDirectoryPaths.Any(x => x == record.FullPath))
Main.Settings.IndexSearchExcludedDirectoryPaths.Add(record.FullPath);
if(!Main.Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => x == record.FullPath))
Main.Settings.IndexSearchExcludedSubdirectoryPaths.Add(record.FullPath);
return false;
},

View file

@ -112,8 +112,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
if (!_settings.UseWindowsIndexForDirectorySearch)
return false;
if (_settings.IndexSearchExcludedDirectoryPaths
.Any(x => x == FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath)))
if (_settings.IndexSearchExcludedSubdirectoryPaths
.Any(x => FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).StartsWith(x)))
return false;
return _indexSearch.PathIsIndexed(locationPath);

View file

@ -17,6 +17,6 @@ namespace Flow.Launcher.Plugin.Explorer
public bool UseWindowsIndexForDirectorySearch { get; set; } = true;
[JsonProperty]
public List<string> IndexSearchExcludedDirectoryPaths { get; set; } = new List<string>();
public List<string> IndexSearchExcludedSubdirectoryPaths { get; set; } = new List<string>();
}
}