Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
26 changes: 20 additions & 6 deletions client/modules/IDE/components/KeyboardShortcutModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import { metaKeyName, metaKey } from '../../../utils/metaKey';

function KeyboardShortcutModal() {
const { t } = useTranslation();
const replaceCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + H` : `${metaKeyName} + ⌥ + F`;
const newFileCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + Alt + N` : `${metaKeyName} + ⌥ + N`;
const renameCommand = metaKey === 'Ctrl' ? 'F2' : 'Ctrl + F2';
const moveLineUpCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Shift + Up`
: `${metaKeyName} + Ctrl + Up`;
const moveLineDownCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Shift + Down`
: `${metaKeyName} + Ctrl + Down`;
return (
<div className="keyboard-shortcuts">
<h3 className="keyboard-shortcuts__title">
Expand Down Expand Up @@ -48,10 +54,6 @@ function KeyboardShortcutModal() {
{t('KeyboardShortcuts.CodeEditing.FindPreviousTextMatch')}
</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">{replaceCommand}</span>
<span>{t('KeyboardShortcuts.CodeEditing.ReplaceTextMatch')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">{metaKeyName} + [</span>
<span>{t('KeyboardShortcuts.CodeEditing.IndentCodeLeft')}</span>
Expand Down Expand Up @@ -80,6 +82,18 @@ function KeyboardShortcutModal() {
<span className="keyboard-shortcut__command">{renameCommand}</span>
<span>{t('KeyboardShortcuts.CodeEditing.RenameVariable')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{moveLineUpCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.MoveLineUp')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{moveLineDownCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.MoveLineDown')}</span>
</li>
</ul>
<h3 className="keyboard-shortcuts__title">
{t('KeyboardShortcuts.General')}
Expand Down
6 changes: 4 additions & 2 deletions translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
"SublimeText": "Sublime Text shortcuts",
"CodeEditing": {
"Tidy": "Tidy",
"FindText": "Find Text",
"FindText": "Find / Replace Text",
"FindNextMatch": "Find Next Match",
"FindPrevMatch": "Find Previous Match",
"ReplaceTextMatch": "Replace Text Match",
Expand All @@ -269,7 +269,9 @@
"CodeEditing": "Code Editing",
"ColorPicker": "Show Inline Color Picker",
"CreateNewFile": "Create New File",
"RenameVariable": "Rename Variable"
"RenameVariable": "Rename Variable",
"MoveLineUp": "Move Line Up",
"MoveLineDown": "Move Line Down"
},
"General": "General",
"GeneralSelection": {
Expand Down
Loading