From ced824d791c7cd2e78a26aa5695d328e4463bfc4 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Tue, 14 Oct 2025 22:49:03 -0300 Subject: [PATCH] is equals --- Flow.Launcher/Helper/ResultHelper.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; + } }