Skip to content

Commit f801d1f

Browse files
committed
make use of variable metaKey
1 parent 25f3ffa commit f801d1f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ window.JSHINT = JSHINT;
6363
window.CSSLint = CSSLint;
6464
window.HTMLHint = HTMLHint;
6565

66-
67-
// delete CodeMirror.keyMap.sublime['Shift-Cmd-F'];
68-
69-
console.log(CodeMirror.keyMap.sublime);
70-
7166
const IS_TAB_INDENT = false;
7267
const INDENTATION_AMOUNT = 2;
7368

@@ -173,7 +168,8 @@ class Editor extends React.Component {
173168
// 91 === Cmd
174169
// 16 === Shift
175170
// 70 === f
176-
if (this.map[91] && this.map[16] && this.map[70]) {
171+
// 17 === Ctrl
172+
if (((metaKey === 'Cmd' && this.map[91]) || (metaKey === 'Ctrl' && this.map[17])) && this.map[16] && this.map[70]) {
177173
e.preventDefault(); // prevent browser's default behaviour
178174
this.tidyCode();
179175
}
@@ -339,7 +335,7 @@ class Editor extends React.Component {
339335
}
340336
}
341337

342-
handleKey(map, e) { // update the state of each key pressed and released
338+
handleKey(map, e) { // update the 'keydown 'state of each key
343339
map[e.keyCode] = e.type === 'keydown';
344340
}
345341

0 commit comments

Comments
 (0)