Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed close tab and close window shortcut #1381

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CodeEdit/Features/Tabs/Views/TabBarItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ struct TabBarItemView: View {
// Close Tab Shortcut:
// Using an invisible button to contain the keyboard shortcut is simply
// because the keyboard shortcut has an unexpected bug when working with
// custom buttonStyle. This is an workaround and it works as expected.
// custom buttonStyle. This is a workaround and it works as expected.
Button(
action: closeAction,
label: { EmptyView() }
)
.frame(width: 0, height: 0)
.keyboardShortcut("w", modifiers: [.command])
.hidden()
.opacity(0)
}
// Switch Tab Shortcut:
// Using an invisible button to contain the keyboard shortcut is simply
Expand Down
7 changes: 1 addition & 6 deletions CodeEdit/Features/WindowCommands/FileCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ struct FileCommands: Commands {
}

CommandGroup(replacing: .saveItem) {
Button("Close Tab") {
FastestMolasses marked this conversation as resolved.
Show resolved Hide resolved
NSApp.sendAction(#selector(NSWindow.close), to: nil, from: nil)
}
.keyboardShortcut("w")

Button("Close Editor") {

NSApp.sendAction(#selector(NSWindow.close), to: nil, from: nil)
}
.keyboardShortcut("w", modifiers: [.control, .shift, .command])

Expand Down