Merge pull request #1549 from marcoarnulfo/fix/duplicate-shortcut
Keyboard Shortcuts: Duplicate is listed, so it can be given a shortcut
This commit is contained in:
commit
523fd6e185
|
|
@ -132,7 +132,15 @@ pub fn specs() -> Vec<CommandSpec> {
|
|||
has_selection_or_guides,
|
||||
clear
|
||||
),
|
||||
cmd!("edit.duplicate", "Duplicate", [], None, "{dx?, dy?} duplicate the selection in place (offset optional)", has_selection, duplicate),
|
||||
cmd!(
|
||||
"edit.duplicate",
|
||||
"Duplicate",
|
||||
["Edit"],
|
||||
None,
|
||||
"{dx?, dy?} duplicate the selection in place (offset optional)",
|
||||
has_selection,
|
||||
duplicate
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -955,4 +955,13 @@ mod tests {
|
|||
let mut seen = HashSet::new();
|
||||
assert!(entries().iter().all(|e| seen.insert(e.key.clone())), "duplicate entries");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn duplicate_can_be_given_a_shortcut() {
|
||||
// Duplicate has no default chord (#1539): it must still be listed so one can be set.
|
||||
assert_eq!(entry("edit.duplicate").map(|e| e.group.as_str()), Some("Edit"));
|
||||
let mut ov = BTreeMap::new();
|
||||
assign(&mut ov, "edit.duplicate", Some("Cmd+Alt+Shift+F8"), false).unwrap();
|
||||
assert_eq!(effective_in(&ov, "edit.duplicate").as_deref(), Some("Cmd+Alt+Shift+F8"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue