Added workspaces shortcuts (#1328)

- added Alt+Space for opening Workspaces context menu (which can then be navigated normally with arrows)
- added Alt+1 through Alt+9 for switching to corresponding workspace
This commit is contained in:
popara 2025-05-17 07:17:10 +02:00 committed by GitHub
parent 506dbc218c
commit 01945f231e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 63 additions and 3 deletions

View file

@ -463,6 +463,14 @@ namespace SourceGit.ViewModels
return menu;
}
public void SwitchWorkspace(int idx)
{
var pref = Preferences.Instance;
if (idx >= pref.Workspaces.Count || pref.Workspaces[idx].IsActive) return;
SwitchWorkspace(pref.Workspaces[idx]);
}
private string GetRepositoryGitDir(string repo)
{
var fullpath = Path.Combine(repo, ".git");
@ -493,7 +501,7 @@ namespace SourceGit.ViewModels
return new Commands.QueryGitDir(repo).Result();
}
private void SwitchWorkspace(Workspace to)
{
foreach (var one in Pages)