aboutsummaryrefslogtreecommitdiff
path: root/src/config/keybinds.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-22 02:21:12 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-22 02:23:35 +0300
commit0148c1379b76c5c0a9d05588c07dcb06ec32f93f (patch)
tree554766d959c738ca2aa433c3d4b4a7de25568008 /src/config/keybinds.rs
parenta9ff4012bdca0dbdbc77bc6e53a430689fc899be (diff)
feat: add git worktree workspace management
refs #137
Diffstat (limited to 'src/config/keybinds.rs')
-rw-r--r--src/config/keybinds.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/config/keybinds.rs b/src/config/keybinds.rs
index 1c9c491b..edd64c90 100644
--- a/src/config/keybinds.rs
+++ b/src/config/keybinds.rs
@@ -246,6 +246,9 @@ pub struct Keybinds {
pub help: ActionKeybinds,
pub settings: ActionKeybinds,
pub new_workspace: ActionKeybinds,
+ pub new_worktree: ActionKeybinds,
+ pub open_worktree: ActionKeybinds,
+ pub remove_worktree: ActionKeybinds,
pub rename_workspace: ActionKeybinds,
pub close_workspace: ActionKeybinds,
pub workspace_picker: ActionKeybinds,
@@ -375,6 +378,9 @@ impl Config {
help: action!("keys.help", &self.keys.help),
settings: action!("keys.settings", &self.keys.settings),
new_workspace: action!("keys.new_workspace", &self.keys.new_workspace),
+ new_worktree: action!("keys.new_worktree", &self.keys.new_worktree),
+ open_worktree: action!("keys.open_worktree", &self.keys.open_worktree),
+ remove_worktree: action!("keys.remove_worktree", &self.keys.remove_worktree),
rename_workspace: action!("keys.rename_workspace", &self.keys.rename_workspace),
close_workspace: action!("keys.close_workspace", &self.keys.close_workspace),
workspace_picker: action!("keys.workspace_picker", &self.keys.workspace_picker),
@@ -1042,6 +1048,25 @@ next_tab = "prefix+n"
}
#[test]
+ fn new_worktree_defaults_to_prefix_shift_g() {
+ let kb = Config::default().keybinds();
+ assert_eq!(
+ binding_triggers(&kb.new_worktree),
+ vec![BindingTrigger::Prefix((
+ KeyCode::Char('g'),
+ KeyModifiers::SHIFT
+ ))]
+ );
+ }
+
+ #[test]
+ fn open_and_remove_worktree_keybinds_are_unset_by_default() {
+ let kb = Config::default().keybinds();
+ assert!(kb.open_worktree.bindings.is_empty());
+ assert!(kb.remove_worktree.bindings.is_empty());
+ }
+
+ #[test]
fn array_bindings_allow_prefix_and_modified_direct() {
let config: Config = toml::from_str(
r#"