Merge pull request #1786 from VictoriousRaptor/ExpandShortcutsWhenNeeded

Expand builtin shortcuts when needed
This commit is contained in:
Kevin Zhang 2023-01-12 15:17:23 -06:00 committed by GitHub
commit 29282e47d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -841,15 +841,20 @@ namespace Flow.Launcher.ViewModel
queryBuilder.Replace('@' + shortcut.Key, shortcut.Expand());
}
string customExpanded = queryBuilder.ToString();
Application.Current.Dispatcher.Invoke(() =>
{
foreach (var shortcut in builtInShortcuts)
{
try
{
var expansion = shortcut.Expand();
queryBuilder.Replace(shortcut.Key, expansion);
queryBuilderTmp.Replace(shortcut.Key, expansion);
if (customExpanded.Contains(shortcut.Key))
{
var expansion = shortcut.Expand();
queryBuilder.Replace(shortcut.Key, expansion);
queryBuilderTmp.Replace(shortcut.Key, expansion);
}
}
catch (Exception e)
{