@@ -228,6 +228,32 @@ private void InitializeKeyCommands()
228
228
}
229
229
} ) ;
230
230
231
+ AutocompleteQueryCommand = new RelayCommand ( _ =>
232
+ {
233
+ var result = SelectedResults . SelectedItem ? . Result ;
234
+ if ( result != null ) // SelectedItem returns null if selection is empty.
235
+ {
236
+ var autoCompleteText = result . Title ;
237
+
238
+ if ( ! string . IsNullOrEmpty ( result . AutoCompleteText ) )
239
+ {
240
+ autoCompleteText = result . AutoCompleteText ;
241
+ }
242
+ else if ( ! string . IsNullOrEmpty ( SelectedResults . SelectedItem ? . QuerySuggestionText ) )
243
+ {
244
+ autoCompleteText = SelectedResults . SelectedItem . QuerySuggestionText ;
245
+ }
246
+
247
+ var SpecialKeyState = GlobalHotkey . Instance . CheckModifiers ( ) ;
248
+ if ( SpecialKeyState . ShiftPressed )
249
+ {
250
+ autoCompleteText = result . SubTitle ;
251
+ }
252
+
253
+ ChangeQueryText ( autoCompleteText ) ;
254
+ }
255
+ } ) ;
256
+
231
257
LoadContextMenuCommand = new RelayCommand ( _ =>
232
258
{
233
259
if ( SelectedIsFromQueryResults ( ) )
@@ -287,7 +313,6 @@ private void InitializeKeyCommands()
287
313
public bool GameModeStatus { get ; set ; }
288
314
289
315
private string _queryText ;
290
-
291
316
public string QueryText
292
317
{
293
318
get => _queryText ;
@@ -383,6 +408,7 @@ private ResultsViewModel SelectedResults
383
408
public ICommand OpenSettingCommand { get ; set ; }
384
409
public ICommand ReloadPluginDataCommand { get ; set ; }
385
410
public ICommand ClearQueryCommand { get ; private set ; }
411
+ public ICommand AutocompleteQueryCommand { get ; set ; }
386
412
387
413
public string OpenResultCommandModifiers { get ; private set ; }
388
414
0 commit comments