diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index f3360d9a98a..02b27cf281c 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -506,12 +506,16 @@ private void OnKeyDown(object sender, KeyEventArgs e) 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; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index a3691e98e30..2fa9bf1a23d 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -254,10 +254,14 @@ private void InitializeKeyCommands() 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(_ => diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index 01a19d871c8..db24825d098 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -310,4 +310,4 @@ public void Update(List newItems, CancellationToken token = def } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index f44263ff1b1..0066fc6af75 100644 --- a/README.md +++ b/README.md @@ -215,17 +215,18 @@ And you can download