Skip to content

Commit

Permalink
Restore dynamic filtering while typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Exarilo committed Oct 23, 2024
1 parent 2031f20 commit 2f7e246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ public List<Result> Query(Query query)
private bool MatchesSearch(SettingItem item, string fullSearch)
{
string searchKeyword = item.Keyword.Trim().ToLower();
if (!fullSearch.StartsWith(searchKeyword, StringComparison.OrdinalIgnoreCase))
return false;

string searchBeforeDash = fullSearch.Split('-')[0].Trim().ToLower();
string remainingSearch = fullSearch.Substring(searchKeyword.Length).Trim();

return searchBeforeDash.StartsWith(searchKeyword, StringComparison.OrdinalIgnoreCase);
return string.IsNullOrEmpty(remainingSearch) || remainingSearch.Split(' ')
.All(arg => item.Title.ToLower().Contains(arg));
}

private List<string> GetAndRemoveArgs(ref string query)
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "LinkOpener",
"Description": "Allows you to open URLs using keywords set in the settings",
"Author": "Exarilo",
"Version": "1.1.2",
"Version": "1.1.3",
"Language": "csharp",
"Website": "https://github.com/Exarilo/Flow.Launcher.Plugin.LinkOpener",
"IcoPath": "Images\\app.png",
Expand Down

0 comments on commit 2f7e246

Please sign in to comment.