Change New Markdown shortcut from ⌘⇧N to ⌘⇧M (#724)
⌘⇧N conflicts with the well-known "New Window" convention in VS Code and Chrome. ⌘⇧M is a clear mnemonic for Markdown and doesn't clash with any existing shortcut. Also adds New Browser Tab and New Markdown entries to the Settings keyboard shortcuts pane.
This commit is contained in:
parent
7db6270b91
commit
2e2e151aa0
|
|
@ -285,7 +285,7 @@ function Terminal(): React.JSX.Element | null {
|
|||
return
|
||||
}
|
||||
try {
|
||||
// Why: the global Cmd/Ctrl+Shift+N shortcut is handled here rather than
|
||||
// Why: the global Cmd/Ctrl+Shift+M shortcut is handled here rather than
|
||||
// inside a specific TabGroupPanel, so it must snapshot the store's
|
||||
// current focused group explicitly. Otherwise split layouts fall back to
|
||||
// the ambient/default group and open the file in the wrong pane.
|
||||
|
|
@ -558,8 +558,8 @@ function Terminal(): React.JSX.Element | null {
|
|||
}
|
||||
}
|
||||
|
||||
// Cmd/Ctrl+Shift+N - new file
|
||||
if (mod && e.shiftKey && e.key.toLowerCase() === 'n' && !e.repeat) {
|
||||
// Cmd/Ctrl+Shift+M - new markdown file
|
||||
if (mod && e.shiftKey && e.key.toLowerCase() === 'm' && !e.repeat) {
|
||||
e.preventDefault()
|
||||
void handleNewFile()
|
||||
return
|
||||
|
|
|
|||
|
|
@ -105,10 +105,20 @@ const SHORTCUT_GROUP_DEFINITIONS: ShortcutGroupDefinition[] = [
|
|||
title: 'Terminal Tabs',
|
||||
items: [
|
||||
{
|
||||
action: 'New tab',
|
||||
searchKeywords: ['shortcut', 'tab'],
|
||||
action: 'New Terminal',
|
||||
searchKeywords: ['shortcut', 'tab', 'terminal'],
|
||||
keys: ({ mod }) => [mod, 'T']
|
||||
},
|
||||
{
|
||||
action: 'New Browser Tab',
|
||||
searchKeywords: ['shortcut', 'tab', 'browser'],
|
||||
keys: ({ mod, shift }) => [mod, shift, 'B']
|
||||
},
|
||||
{
|
||||
action: 'New Markdown',
|
||||
searchKeywords: ['shortcut', 'tab', 'markdown', 'file'],
|
||||
keys: ({ mod, shift }) => [mod, shift, 'M']
|
||||
},
|
||||
{
|
||||
action: 'Close active tab / pane',
|
||||
searchKeywords: ['shortcut', 'close', 'tab', 'pane'],
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import {
|
|||
const isMac = navigator.userAgent.includes('Mac')
|
||||
const NEW_TERMINAL_SHORTCUT = isMac ? '⌘T' : 'Ctrl+T'
|
||||
const NEW_BROWSER_SHORTCUT = isMac ? '⌘⇧B' : 'Ctrl+Shift+B'
|
||||
const NEW_FILE_SHORTCUT = isMac ? '⌘⇧N' : 'Ctrl+Shift+N'
|
||||
const NEW_FILE_SHORTCUT = isMac ? '⌘⇧M' : 'Ctrl+Shift+M'
|
||||
|
||||
type TabBarProps = {
|
||||
tabs: TerminalTab[]
|
||||
|
|
|
|||
Loading…
Reference in New Issue