Skip to content

Commit e13c647

Browse files
committed
Implement Requery option and requery when calling customQueryHotkey
1 parent 1cf2f1b commit e13c647

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
110110
return;
111111

112112
mainViewModel.MainWindowVisibility = Visibility.Visible;
113-
mainViewModel.ChangeQueryText(hotkey.ActionKeyword);
113+
mainViewModel.ChangeQueryText(hotkey.ActionKeyword, true);
114114
});
115115
}
116116

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ public PublicAPIInstance(SettingWindowViewModel settingsVM, MainViewModel mainVM
4848

4949
public void ChangeQuery(string query, bool requery = false)
5050
{
51-
_mainVM.ChangeQueryText(query);
52-
}
53-
54-
public void ChangeQueryText(string query, bool selectAll = false)
55-
{
56-
_mainVM.ChangeQueryText(query);
51+
_mainVM.ChangeQueryText(query, requery);
5752
}
5853

5954
public void RestartApp()

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,16 @@ public string QueryText
285285
/// but we don't want to move cursor to end when query is updated from TextBox
286286
/// </summary>
287287
/// <param name="queryText"></param>
288-
public void ChangeQueryText(string queryText)
288+
public void ChangeQueryText(string queryText, bool reQuery)
289289
{
290-
QueryText = queryText;
290+
if (QueryText!=queryText)
291+
{
292+
QueryText = queryText;
293+
}
294+
else if (reQuery)
295+
{
296+
Query();
297+
}
291298
QueryTextCursorMovedToEnd = true;
292299
}
293300

0 commit comments

Comments
 (0)