M1.6: buffer.close default shortcut Mod+W
Spec field only, so the editor's close-tab shortcut comes from the engine like Mod+S and Mod+Alt+S. Registry test checks the three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b50400d2e5
commit
0fb7e33fc7
2 changed files with 8 additions and 1 deletions
|
|
@ -193,7 +193,7 @@ impl Command for Close {
|
|||
id: "buffer.close",
|
||||
label: "Close Buffer",
|
||||
menu_path: None,
|
||||
default_shortcut: None,
|
||||
default_shortcut: Some("Mod+W"),
|
||||
params: "{ id: number, force?: bool (discard unsaved changes) }; returns null; fails with unsaved_changes if the buffer is dirty and force is not set",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,6 +249,13 @@ mod tests {
|
|||
let quit = by_id("app.quit");
|
||||
assert_eq!(quit.default_shortcut.as_deref(), Some("Mod+Q"));
|
||||
assert!(quit.enabled);
|
||||
for (id, shortcut) in [
|
||||
("file.save", "Mod+S"),
|
||||
("file.saveAll", "Mod+Alt+S"),
|
||||
("buffer.close", "Mod+W"),
|
||||
] {
|
||||
assert_eq!(by_id(id).default_shortcut.as_deref(), Some(shortcut));
|
||||
}
|
||||
assert!(!by_id("test.disabled").enabled);
|
||||
assert!(by_id("project.open").enabled);
|
||||
assert!(!by_id("file.open").enabled, "needs a project");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue