Skip to content

Commit 87c069b

Browse files
committed
Initial commit
1 parent 2e67979 commit 87c069b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,15 @@ private void OnKeyDown(object sender, KeyEventArgs e)
469469
e.Handled = true;
470470
}
471471
break;
472+
case Key.Back:
473+
if (_viewModel.SelectedIsFromQueryResults()
474+
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length
475+
&& !string.IsNullOrEmpty(QueryTextBox.Text) && QueryTextBox.Text.Contains(":\\"))
476+
{
477+
_viewModel.BackspaceCommand.Execute(null);
478+
e.Handled = true;
479+
}
480+
break;
472481
default:
473482
break;
474483

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using Microsoft.VisualStudio.Threading;
2121
using System.Threading.Channels;
2222
using ISavable = Flow.Launcher.Plugin.ISavable;
23-
23+
using System.IO;
2424

2525
namespace Flow.Launcher.ViewModel
2626
{
@@ -228,6 +228,11 @@ private void InitializeKeyCommands()
228228
}
229229
});
230230

231+
BackspaceCommand = new RelayCommand(index =>
232+
{
233+
ChangeQueryText(Path.GetDirectoryName(QueryText));
234+
});
235+
231236
LoadContextMenuCommand = new RelayCommand(_ =>
232237
{
233238
if (SelectedIsFromQueryResults())
@@ -371,6 +376,7 @@ private ResultsViewModel SelectedResults
371376
public double MainWindowWidth => _settings.WindowSize;
372377

373378
public ICommand EscCommand { get; set; }
379+
public ICommand BackspaceCommand { get; set; }
374380
public ICommand SelectNextItemCommand { get; set; }
375381
public ICommand SelectPrevItemCommand { get; set; }
376382
public ICommand SelectNextPageCommand { get; set; }

0 commit comments

Comments
 (0)