mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #987 from Flow-Launcher/update_back_prev_dir_logic
[Dev] Add support for action keyword when using Ctrl + Backspace
This commit is contained in:
commit
520d2370db
4 changed files with 20 additions and 11 deletions
|
|
@ -506,12 +506,16 @@ namespace Flow.Launcher
|
|||
if (specialKeyState.CtrlPressed)
|
||||
{
|
||||
if (_viewModel.SelectedIsFromQueryResults()
|
||||
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length
|
||||
&& FilesFolders.IsLocationPathString(QueryTextBox.Text))
|
||||
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length)
|
||||
{
|
||||
|
||||
_viewModel.BackspaceCommand.Execute(null);
|
||||
e.Handled = true;
|
||||
var queryWithoutActionKeyword =
|
||||
QueryBuilder.Build(QueryTextBox.Text.Trim(), PluginManager.NonGlobalPlugins).Search;
|
||||
|
||||
if (FilesFolders.IsLocationPathString(queryWithoutActionKeyword))
|
||||
{
|
||||
_viewModel.BackspaceCommand.Execute(null);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -254,10 +254,14 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
BackspaceCommand = new RelayCommand(index =>
|
||||
{
|
||||
var path = QueryText;
|
||||
var query = QueryBuilder.Build(QueryText.Trim(), PluginManager.NonGlobalPlugins);
|
||||
|
||||
// GetPreviousExistingDirectory does not require trailing '\', otherwise will return empty string
|
||||
ChangeQueryText(FilesFolders.GetPreviousExistingDirectory(FilesFolders.IsLocationPathString, path.TrimEnd('\\')));
|
||||
var path = FilesFolders.GetPreviousExistingDirectory((_) => true, query.Search.TrimEnd('\\'));
|
||||
|
||||
var actionKeyword = string.IsNullOrEmpty(query.ActionKeyword) ? string.Empty : $"{query.ActionKeyword} ";
|
||||
|
||||
ChangeQueryText($"{actionKeyword}{path}");
|
||||
});
|
||||
|
||||
LoadContextMenuCommand = new RelayCommand(_ =>
|
||||
|
|
|
|||
|
|
@ -310,4 +310,4 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,17 +215,18 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
|
|||
|
||||
| Hotkey | Description |
|
||||
| ------------------------------------------------------------ | -------------------------------------------- |
|
||||
| <kbd>Alt</kbd>+ <kbd>Space</kbd> | Open Search Box (Default and Configurable) |
|
||||
| <kbd>Alt</kbd>+ <kbd>Space</kbd> | Open Search Box (default and configurable) |
|
||||
| <kbd>Enter</kbd> | Execute |
|
||||
| <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> | Run As Admin |
|
||||
| <kbd>↑</kbd><kbd>↓</kbd> | Scroll up & Down |
|
||||
| <kbd>←</kbd><kbd>→</kbd> | Back to Result / Open Context Menu |
|
||||
| <kbd>Ctrl</kbd> +<kbd>o</kbd> , <kbd>Shift</kbd> +<kbd>Enter</kbd> | Open Context Menu |
|
||||
| <kbd>Tab</kbd> | Autocomplete |
|
||||
| <kbd>Ctrl</kbd> +<kbd>o</kbd> , <kbd>Shift</kbd> +<kbd>Enter</kbd> | Open Context Menu |
|
||||
| <kbd>Tab</kbd> | Autocomplete |
|
||||
| <kbd>Esc</kbd> | Back to Result & Close |
|
||||
| <kbd>Ctrl</kbd> +<kbd>i</kbd> | Open Setting Window |
|
||||
| <kbd>F5</kbd> | Reload All Plugin Data & Window Search Index |
|
||||
| <kbd>Ctrl</kbd> + <kbd>h</kbd> | Open Query History |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Backspace</kbd> | Back to Previous Directory |
|
||||
|
||||
|
||||
## System Command List
|
||||
|
|
|
|||
Loading…
Reference in a new issue