From 9ccdf597d9b2bfa078032778ad59f9b8daf90710 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:00:34 +0800 Subject: [PATCH] change text textbox when expanding builtin shortcuts --- Flow.Launcher/ViewModel/MainViewModel.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index cc535ea05..9b373d641 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -739,9 +739,10 @@ namespace Flow.Launcher.ViewModel } } - private static Query ConstructQuery(string queryText, IEnumerable customShortcuts, IEnumerable builtInShortcuts) + private Query ConstructQuery(string queryText, IEnumerable customShortcuts, IEnumerable builtInShortcuts) { StringBuilder queryBuilder = new(queryText); + StringBuilder queryBuilderTmp = new(queryText); foreach (var shortcut in customShortcuts) { @@ -756,8 +757,13 @@ namespace Flow.Launcher.ViewModel foreach (var shortcut in builtInShortcuts) { queryBuilder.Replace(shortcut.Key, shortcut.Expand()); + queryBuilderTmp.Replace(shortcut.Key, shortcut.Expand()); } + // show expanded builtin shortcuts + // use private field to avoid infinite recursion + _queryText = queryBuilderTmp.ToString(); + var query = QueryBuilder.Build(queryBuilder.ToString().Trim(), PluginManager.NonGlobalPlugins); return query; }