diff --git a/Flow.Launcher/Helper/ResultHelper.cs b/Flow.Launcher/Helper/ResultHelper.cs index f99ba0377..a0a7b0793 100644 --- a/Flow.Launcher/Helper/ResultHelper.cs +++ b/Flow.Launcher/Helper/ResultHelper.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using Flow.Launcher.Core.Plugin; +using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Storage; @@ -41,4 +42,18 @@ public static class ResultHelper return null; } } + + public static bool IsEquals(this Result result, LastOpenedHistoryItem item, HistoryStyle style) + { + bool keyMatches = string.IsNullOrEmpty(result.RecordKey) + ? item.Title == result.Title + : item.RecordKey == result.RecordKey; + + bool queryMatches = style != HistoryStyle.Query || item.Query == result.OriginQuery.RawQuery; + + return keyMatches + && queryMatches + && item.PluginID == result.PluginID + && item.HistoryStyle == style; + } }