@@ -87,7 +87,6 @@ class Editor extends React.Component {
8787 this . findPrev = this . findPrev . bind ( this ) ;
8888 this . showReplace = this . showReplace . bind ( this ) ;
8989 this . getContent = this . getContent . bind ( this ) ;
90- this . handleKey = this . handleKey . bind ( this ) ;
9190 }
9291
9392 componentDidMount ( ) {
@@ -155,22 +154,15 @@ class Editor extends React.Component {
155154 }
156155 } , 1000 ) ) ;
157156
158- this . map = { } ;
159-
160157 this . _cm . on ( 'keyup' , ( _cm , e ) => {
161158 const temp = this . props . t ( 'Editor.KeyUpLineNumber' , { lineNumber : parseInt ( ( this . _cm . getCursor ( ) . line ) + 1 , 10 ) } ) ;
162159 document . getElementById ( 'current-line' ) . innerHTML = temp ;
163- this . handleKey ( this . map , e ) ;
164160 } ) ;
165161
166162 this . _cm . on ( 'keydown' , ( _cm , e ) => {
167- this . handleKey ( this . map , e ) ;
168- // 91 === Cmd
169- // 16 === Shift
170163 // 70 === f
171- // 17 === Ctrl
172- if ( ( ( metaKey === 'Cmd' && this . map [ 91 ] ) || ( metaKey === 'Ctrl' && this . map [ 17 ] ) ) && this . map [ 16 ] && this . map [ 70 ] ) {
173- e . preventDefault ( ) ; // prevent browser's default behaviour
164+ if ( ( e . metaKey || e . ctrlKey ) && e . shiftKey && e . keyCode === 70 ) {
165+ e . preventDefault ( ) ;
174166 this . tidyCode ( ) ;
175167 }
176168 } ) ;
@@ -335,10 +327,6 @@ class Editor extends React.Component {
335327 }
336328 }
337329
338- handleKey ( map , e ) { // update the 'keydown 'state of each key
339- map [ e . keyCode ] = e . type === 'keydown' ;
340- }
341-
342330 render ( ) {
343331 const editorSectionClass = classNames ( {
344332 'editor' : true ,
0 commit comments