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__ 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 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",