Skip to content

Commit 072113a

Browse files
Expand builtin shortcuts when needed
1 parent 66a5e1a commit 072113a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,15 +841,20 @@ private Query ConstructQuery(string queryText, IEnumerable<CustomShortcutModel>
841841
queryBuilder.Replace('@' + shortcut.Key, shortcut.Expand());
842842
}
843843

844+
string customExpanded = queryBuilder.ToString();
845+
844846
Application.Current.Dispatcher.Invoke(() =>
845847
{
846848
foreach (var shortcut in builtInShortcuts)
847849
{
848850
try
849851
{
850-
var expansion = shortcut.Expand();
851-
queryBuilder.Replace(shortcut.Key, expansion);
852-
queryBuilderTmp.Replace(shortcut.Key, expansion);
852+
if (customExpanded.Contains(shortcut.Key))
853+
{
854+
var expansion = shortcut.Expand();
855+
queryBuilder.Replace(shortcut.Key, expansion);
856+
queryBuilderTmp.Replace(shortcut.Key, expansion);
857+
}
853858
}
854859
catch (Exception e)
855860
{

0 commit comments

Comments
 (0)