Initial Tab complete

This commit is contained in:
Garulf 2021-12-01 04:20:54 -05:00
parent 96bcf1b1f0
commit 5a733d05db
2 changed files with 18 additions and 1 deletions

View file

@ -41,7 +41,7 @@
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}" />
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
<KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}" />
<KeyBinding Key="Tab" Command="{Binding ReplaceQueryWithResult}" />
<KeyBinding
Key="Tab"
Command="{Binding SelectPrevItemCommand}"

View file

@ -228,6 +228,22 @@ namespace Flow.Launcher.ViewModel
}
});
ReplaceQueryWithResult = new RelayCommand(index =>
{
var results = SelectedResults;
if (index != null)
{
results.SelectedIndex = int.Parse(index.ToString());
}
var result = results.SelectedItem?.Result;
if (result != null) // SelectedItem returns null if selection is empty.
{
ChangeQueryText(result.Title, true);
}
});
LoadContextMenuCommand = new RelayCommand(_ =>
{
if (SelectedIsFromQueryResults())
@ -383,6 +399,7 @@ namespace Flow.Launcher.ViewModel
public ICommand OpenSettingCommand { get; set; }
public ICommand ReloadPluginDataCommand { get; set; }
public ICommand ClearQueryCommand { get; private set; }
public ICommand ReplaceQueryWithResult { get; set; }
public string OpenResultCommandModifiers { get; private set; }