File tree Expand file tree Collapse file tree 5 files changed +20
-1
lines changed
translations/locales/en-US Expand file tree Collapse file tree 5 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ class Nav extends React.PureComponent {
197197 onClick = { ( ) => this . props . newFile ( this . props . rootFile . id ) }
198198 >
199199 { this . props . t ( 'Nav.Sketch.AddFile' ) }
200+ < span className = "nav__keyboard-shortcut" > { '\u21E7' } +N</ span >
200201 </ NavMenuItem >
201202 < NavMenuItem
202203 onClick = { ( ) => this . props . newFolder ( this . props . rootFile . id ) }
Original file line number Diff line number Diff line change @@ -373,6 +373,11 @@ exports[`Nav renders editor version 1`] = `
373373 >
374374 <button >
375375 Add File
376+ <span
377+ class = " nav__keyboard-shortcut"
378+ >
379+ ⇧+N
380+ </span >
376381 </button >
377382 </li >
378383 <li
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ function KeyboardShortcutModal() {
6969 < span className = "keyboard-shortcut__command" > { metaKeyName } + K</ span >
7070 < span > { t ( 'KeyboardShortcuts.CodeEditing.ColorPicker' ) } </ span >
7171 </ li >
72+ < li className = "keyboard-shortcut-item" >
73+ < span className = "keyboard-shortcut__command" > { '\u21E7' } + N</ span >
74+ < span > { t ( 'KeyboardShortcuts.CodeEditing.CreateNewFile' ) } </ span >
75+ </ li >
7276 </ ul >
7377 < h3 className = "keyboard-shortcuts__title" > General</ h3 >
7478 < ul className = "keyboard-shortcuts__list" >
Original file line number Diff line number Diff line change @@ -229,6 +229,14 @@ class IDEView extends React.Component {
229229 this . props . closeNewFileModal ( ) ;
230230 }
231231 }
232+ if ( e . keyCode === 78 && e . shiftKey ) {
233+ e . preventDefault ( ) ;
234+ e . stopPropagation ( ) ;
235+ this . props . newFile (
236+ this . props . files . filter ( ( file ) => file . name === 'root' ) [ 0 ] . id
237+ ) ;
238+ // 78 === n
239+ }
232240 }
233241
234242 handleUnsavedChanges = ( nextLocation ) =>
Original file line number Diff line number Diff line change 192192 "FindNextTextMatch" : " Find Next Text Match" ,
193193 "FindPreviousTextMatch" : " Find Previous Text Match" ,
194194 "CodeEditing" : " Code Editing" ,
195- "ColorPicker" : " Show Inline Color Picker"
195+ "ColorPicker" : " Show Inline Color Picker" ,
196+ "CreateNewFile" : " Create New File"
196197 },
197198 "General" : {
198199 "StartSketch" : " Start Sketch" ,
You can’t perform that action at this time.
0 commit comments