mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
cache keywordIndex
This commit is contained in:
parent
7a0be2c610
commit
874a785be4
1 changed files with 8 additions and 7 deletions
|
|
@ -26,20 +26,21 @@ namespace Flow.Launcher.Plugin.Sys
|
|||
LoadThemes();
|
||||
}
|
||||
|
||||
string search = query.Search[(query.Search.IndexOf(Keyword, StringComparison.Ordinal) + Keyword.Length + 1)..];
|
||||
int keywordIndex = query.Search.IndexOf(Keyword, StringComparison.Ordinal);
|
||||
string search = query.Search[(keywordIndex + Keyword.Length + 1)..];
|
||||
|
||||
if (string.IsNullOrWhiteSpace(search))
|
||||
{
|
||||
return themes.Select(CreateThemeResult)
|
||||
.OrderBy(x => x.Title)
|
||||
.ToList();
|
||||
.OrderBy(x => x.Title)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return themes.Select(theme => (theme, matchResult: context.API.FuzzySearch(search, theme)))
|
||||
.Where(x => x.matchResult.IsSearchPrecisionScoreMet())
|
||||
.Select(x => CreateThemeResult(x.theme, x.matchResult.Score, x.matchResult.MatchData))
|
||||
.OrderBy(x => x.Title)
|
||||
.ToList();
|
||||
.Where(x => x.matchResult.IsSearchPrecisionScoreMet())
|
||||
.Select(x => CreateThemeResult(x.theme, x.matchResult.Score, x.matchResult.MatchData))
|
||||
.OrderBy(x => x.Title)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue