@@ -76,6 +76,7 @@ import IconButton from '../../../../common/IconButton';
7676import contextAwareHinter from '../contextAwareHinter' ;
7777import showRenameDialog from '../showRenameDialog' ;
7878import { handleRename } from '../rename-variable' ;
79+ import { jumpToDefinition } from '../jump-to-definition' ;
7980
8081emmet ( CodeMirror ) ;
8182
@@ -158,6 +159,16 @@ class Editor extends React.Component {
158159
159160 delete this . _cm . options . lint . options . errors ;
160161
162+ this . _cm . getWrapperElement ( ) . addEventListener ( 'click' , ( e ) => {
163+ const isMac = / M a c / . test ( navigator . platform ) ;
164+ const isCtrlClick = isMac ? e . metaKey : e . ctrlKey ;
165+
166+ if ( isCtrlClick ) {
167+ const pos = this . _cm . coordsChar ( { left : e . clientX , top : e . clientY } ) ;
168+ jumpToDefinition . call ( this , pos ) ;
169+ }
170+ } ) ;
171+
161172 const replaceCommand =
162173 metaKey === 'Ctrl' ? `${ metaKey } -H` : `${ metaKey } -Option-F` ;
163174 this . _cm . setOption ( 'extraKeys' , {
@@ -173,6 +184,9 @@ class Editor extends React.Component {
173184 } ,
174185 Enter : 'emmetInsertLineBreak' ,
175186 Esc : 'emmetResetAbbreviation' ,
187+ [ `Shift-${ metaKey } -E` ] : ( cm ) => {
188+ cm . getInputField ( ) . blur ( ) ;
189+ } ,
176190 F2 : ( cm ) => this . renameVariable ( cm ) ,
177191 [ `Shift-Tab` ] : false ,
178192 [ `${ metaKey } -Enter` ] : ( ) => null ,
@@ -591,7 +605,7 @@ class Editor extends React.Component {
591605 < section className = { editorSectionClass } >
592606 < div className = "editor__header" >
593607 < button
594- aria-label = { this . props . t ( 'Editor.OpenSketchARIA ' ) }
608+ aria-label = { this . props . t ( 'Editor.CloseSketchARIA ' ) }
595609 className = "sidebar__contract"
596610 onClick = { ( ) => {
597611 this . props . collapseSidebar ( ) ;
@@ -601,7 +615,7 @@ class Editor extends React.Component {
601615 < LeftArrowIcon focusable = "false" aria-hidden = "true" />
602616 </ button >
603617 < button
604- aria-label = { this . props . t ( 'Editor.CloseSketchARIA ' ) }
618+ aria-label = { this . props . t ( 'Editor.OpenSketchARIA ' ) }
605619 className = "sidebar__expand"
606620 onClick = { this . props . expandSidebar }
607621 >
0 commit comments