From 8a25d4541e5aa69be6fdde2d2c84c581a7a3a383 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:58:38 -0400 Subject: [PATCH 1/3] Add title highlight data --- pyflowlauncher/result.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyflowlauncher/result.py b/pyflowlauncher/result.py index 84a3dc6..626933e 100644 --- a/pyflowlauncher/result.py +++ b/pyflowlauncher/result.py @@ -49,6 +49,7 @@ class Result: AutoCompleteText: Optional[str] = None RoundedIcon: bool = False Preview: Optional[PreviewInfo] = None + TitleHighlightData: Optional[List[int]] = None def as_dict(self) -> Dict[str, Any]: return self.__dict__ From 58859b77f7738646ab2d53e1bb0e3c17edc09148 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:58:57 -0400 Subject: [PATCH 2/3] Update to provide titlehighlight --- pyflowlauncher/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyflowlauncher/utils.py b/pyflowlauncher/utils.py index 8b3aab3..754b9fe 100644 --- a/pyflowlauncher/utils.py +++ b/pyflowlauncher/utils.py @@ -16,5 +16,6 @@ def score_results( query_search_precision=score_cutoff ) if match.matched or (match_on_empty_query and not query): + result.TitleHighlightData = match.index_list result.Score = match.score yield result From d6335497ec6b2bb89df74d69d7d119236eca1234 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:00:08 -0400 Subject: [PATCH 3/3] Update result test --- tests/test_result.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_result.py b/tests/test_result.py index e13c83e..557c897 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -6,6 +6,7 @@ def test_asdict(): Title="Test", SubTitle="Test", IcoPath="Test.png", + TitleHighlightData=[0], ContextData=["Test"], Glyph={"Glyph": "Test", "FontFamily": "Test"}, CopyText="Test", @@ -27,6 +28,7 @@ def test_asdict(): "Title": "Test", "SubTitle": "Test", "IcoPath": "Test.png", + "TitleHighlightData": [0], "Score": 0, "JsonRPCAction": { "Method": "Test",