mirror of
https://github.com/wez/wezterm.git
synced 2024-09-21 11:50:42 +03:00
include key assignments in palette and menubar
Fixup CopyMode key assignments; they were all incorrectly labelled as activating copy mode, which isn't correct. We're just using Debug labelling for them at the moment, need to get that fixed properly. refs: https://github.com/wez/wezterm/issues/1485
This commit is contained in:
parent
85afd9b599
commit
1fad25e926
@ -305,6 +305,47 @@ impl CommandDef {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// And sweep to pick up stuff from their key assignments
|
||||||
|
let inputmap = InputMap::new(config);
|
||||||
|
for entry in inputmap.keys.default.values() {
|
||||||
|
if result
|
||||||
|
.iter()
|
||||||
|
.position(|cmd| cmd.action == entry.action)
|
||||||
|
.is_some()
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if let Some(cmd) = derive_command_from_key_assignment(&entry.action) {
|
||||||
|
result.push(ExpandedCommand {
|
||||||
|
brief: cmd.brief.into(),
|
||||||
|
doc: cmd.doc.into(),
|
||||||
|
keys: vec![],
|
||||||
|
action: entry.action.clone(),
|
||||||
|
menubar: cmd.menubar,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for table in inputmap.keys.by_name.values() {
|
||||||
|
for entry in table.values() {
|
||||||
|
if result
|
||||||
|
.iter()
|
||||||
|
.position(|cmd| cmd.action == entry.action)
|
||||||
|
.is_some()
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if let Some(cmd) = derive_command_from_key_assignment(&entry.action) {
|
||||||
|
result.push(ExpandedCommand {
|
||||||
|
brief: cmd.brief.into(),
|
||||||
|
doc: cmd.doc.into(),
|
||||||
|
keys: vec![],
|
||||||
|
action: entry.action.clone(),
|
||||||
|
menubar: cmd.menubar,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1502,12 +1543,12 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
|
|||||||
args: &[ArgType::ActivePane],
|
args: &[ArgType::ActivePane],
|
||||||
menubar: &["Shell", "Attach"],
|
menubar: &["Shell", "Attach"],
|
||||||
},
|
},
|
||||||
CopyMode(_) => CommandDef {
|
CopyMode(copy_mode) => CommandDef {
|
||||||
brief: "Activate Copy Mode".into(),
|
brief: format!("{copy_mode:?}").into(),
|
||||||
doc: "Activate Copy Mode".into(),
|
doc: "".into(),
|
||||||
keys: vec![],
|
keys: vec![],
|
||||||
args: &[ArgType::ActivePane],
|
args: &[ArgType::ActivePane],
|
||||||
menubar: &["Edit"],
|
menubar: &["Edit", "Copy Mode"],
|
||||||
},
|
},
|
||||||
RotatePanes(direction) => CommandDef {
|
RotatePanes(direction) => CommandDef {
|
||||||
brief: format!("Rotate panes {direction:?}").into(),
|
brief: format!("Rotate panes {direction:?}").into(),
|
||||||
|
Loading…
Reference in New Issue
Block a user