Skip to content

Commit 1756620

Browse files
committed
[#1519] Update replace keyboard shortcut to match VSC
1 parent 10ee0af commit 1756620

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class Editor extends React.Component {
123123

124124
delete this._cm.options.lint.options.errors;
125125

126+
const replaceCommand = metaKey === 'Ctrl' ? `${metaKey}-H` : `${metaKey}-Option-F`;
126127
this._cm.setOption('extraKeys', {
127128
Tab: (cm) => {
128129
// might need to specify and indent more?
@@ -138,7 +139,7 @@ class Editor extends React.Component {
138139
[`${metaKey}-F`]: 'findPersistent',
139140
[`${metaKey}-G`]: 'findNext',
140141
[`Shift-${metaKey}-G`]: 'findPrev',
141-
[`${metaKey}-R`]: 'replace',
142+
replaceCommand: 'replace',
142143
});
143144

144145
this.initializeDocuments(this.props.files);

client/modules/IDE/components/KeyboardShortcutModal.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
22
import { useTranslation } from 'react-i18next';
3-
import { metaKeyName, } from '../../../utils/metaKey';
3+
import { metaKeyName, metaKey } from '../../../utils/metaKey';
44

55
function KeyboardShortcutModal() {
66
const { t } = useTranslation();
7+
const replaceCommand = metaKey === 'Ctrl' ? `${metaKeyName} + H` : `${metaKeyName} + ⌥ + F`;
78
return (
89
<div className="keyboard-shortcuts">
910
<h3 className="keyboard-shortcuts__title">{t('KeyboardShortcuts.CodeEditing.CodeEditing')}</h3>
@@ -35,7 +36,7 @@ function KeyboardShortcutModal() {
3536
</li>
3637
<li className="keyboard-shortcut-item">
3738
<span className="keyboard-shortcut__command">
38-
{metaKeyName} + R
39+
{replaceCommand}
3940
</span>
4041
<span>{t('KeyboardShortcuts.CodeEditing.ReplaceTextMatch')}</span>
4142
</li>

0 commit comments

Comments
 (0)