Skip to content

Commit

Permalink
Merge pull request #2284 from lindapaiste/fix/tidy-code
Browse files Browse the repository at this point in the history
Fix #2278 keyboard shortcut for tidy code shows replace
  • Loading branch information
raclim authored Jul 11, 2023
2 parents 231c01c + 848d1a7 commit dd2f731
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions client/modules/IDE/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Editor extends React.Component {
[`${metaKey}-Enter`]: () => null,
[`Shift-${metaKey}-Enter`]: () => null,
[`${metaKey}-F`]: 'findPersistent',
[`Shift-${metaKey}-F`]: this.tidyCode,
[`${metaKey}-G`]: 'findPersistentNext',
[`Shift-${metaKey}-G`]: 'findPersistentPrev',
[replaceCommand]: 'replace',
Expand Down Expand Up @@ -194,16 +195,6 @@ class Editor extends React.Component {
});

this._cm.on('keydown', (_cm, e) => {
if (
((metaKey === 'Cmd' && e.metaKey) ||
(metaKey === 'Ctrl' && e.ctrlKey)) &&
e.shiftKey &&
e.key === 'f'
) {
e.preventDefault();
this.tidyCode();
}

// Show hint
const mode = this._cm.getOption('mode');
if (/^[a-z]$/i.test(e.key) && (mode === 'css' || mode === 'javascript')) {
Expand Down

0 comments on commit dd2f731

Please sign in to comment.