Expand builtin shortcuts when needed

This commit is contained in:
Vic 2023-01-12 17:06:23 +08:00
parent 66a5e1a044
commit 072113a127

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)
{