@@ -228,6 +228,32 @@ private void InitializeKeyCommands()
228228 }
229229 } ) ;
230230
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+
231257 LoadContextMenuCommand = new RelayCommand ( _ =>
232258 {
233259 if ( SelectedIsFromQueryResults ( ) )
@@ -287,7 +313,6 @@ private void InitializeKeyCommands()
287313 public bool GameModeStatus { get ; set ; }
288314
289315 private string _queryText ;
290-
291316 public string QueryText
292317 {
293318 get => _queryText ;
@@ -383,6 +408,7 @@ private ResultsViewModel SelectedResults
383408 public ICommand OpenSettingCommand { get ; set ; }
384409 public ICommand ReloadPluginDataCommand { get ; set ; }
385410 public ICommand ClearQueryCommand { get ; private set ; }
411+ public ICommand AutocompleteQueryCommand { get ; set ; }
386412
387413 public string OpenResultCommandModifiers { get ; private set ; }
388414
0 commit comments