|
13 | 13 | using Flow.Launcher.Infrastructure.Storage;
|
14 | 14 | using Flow.Launcher.Infrastructure.UserSettings;
|
15 | 15 | using Flow.Launcher.Plugin;
|
| 16 | +using Flow.Launcher.Plugin.SharedCommands; |
16 | 17 | using Flow.Launcher.Storage;
|
17 | 18 | using Flow.Launcher.Infrastructure.Logger;
|
18 | 19 | using Microsoft.VisualStudio.Threading;
|
19 | 20 | using System.Threading.Channels;
|
20 | 21 | using ISavable = Flow.Launcher.Plugin.ISavable;
|
21 | 22 |
|
22 |
| - |
23 | 23 | namespace Flow.Launcher.ViewModel
|
24 | 24 | {
|
25 | 25 | public class MainViewModel : BaseModel, ISavable
|
@@ -252,6 +252,14 @@ private void InitializeKeyCommands()
|
252 | 252 | }
|
253 | 253 | });
|
254 | 254 |
|
| 255 | + BackspaceCommand = new RelayCommand(index => |
| 256 | + { |
| 257 | + var path = QueryText; |
| 258 | + |
| 259 | + // GetPreviousExistingDirectory does not require trailing '\', otherwise will return empty string |
| 260 | + ChangeQueryText(FilesFolders.GetPreviousExistingDirectory(FilesFolders.IsLocationPathString, path.TrimEnd('\\'))); |
| 261 | + }); |
| 262 | + |
255 | 263 | LoadContextMenuCommand = new RelayCommand(_ =>
|
256 | 264 | {
|
257 | 265 | if (SelectedIsFromQueryResults())
|
@@ -398,6 +406,7 @@ private ResultsViewModel SelectedResults
|
398 | 406 | public string PluginIconPath { get; set; } = null;
|
399 | 407 |
|
400 | 408 | public ICommand EscCommand { get; set; }
|
| 409 | + public ICommand BackspaceCommand { get; set; } |
401 | 410 | public ICommand SelectNextItemCommand { get; set; }
|
402 | 411 | public ICommand SelectPrevItemCommand { get; set; }
|
403 | 412 | public ICommand SelectNextPageCommand { get; set; }
|
|
0 commit comments