File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 3838 },
3939 "jupyter.lab.menus" : {
4040 "context" : [
41+ {
42+ "command" : " filebrowser:create-new-file" ,
43+ "selector" : " .jp-DirListing-content" ,
44+ "rank" : 51 ,
45+ "disabled" : true
46+ },
47+ {
48+ "command" : " drives:create-new-file" ,
49+ "selector" : " .jp-DirListing-content" ,
50+ "rank" : 51
51+ },
4152 {
4253 "command" : " filebrowser:create-new-directory" ,
4354 "selector" : " .jp-DirListing-content" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ import {
2323 filterIcon ,
2424 FilenameSearcher ,
2525 IScore ,
26- newFolderIcon
26+ newFolderIcon ,
27+ fileIcon
2728} from '@jupyterlab/ui-components' ;
2829import { CommandRegistry } from '@lumino/commands' ;
2930import { Widget } from '@lumino/widgets' ;
@@ -384,5 +385,16 @@ namespace Private {
384385 icon : newFolderIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
385386 label : 'New Folder'
386387 } ) ;
388+
389+ app . commands . addCommand ( CommandIDs . createNewFile , {
390+ isVisible : ( ) => {
391+ return browser . model . path !== 's3:' ;
392+ } ,
393+ execute : ( ) => {
394+ app . commands . execute ( 'filebrowser:create-new-file' ) ;
395+ } ,
396+ icon : fileIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
397+ label : 'New File'
398+ } ) ;
387399 }
388400}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export namespace CommandIDs {
1111 export const launcher = 'launcher:create' ;
1212 export const toggleFileFilter = 'drives:toggle-file-filter' ;
1313 export const createNewDirectory = 'drives:create-new-directory' ;
14+ export const createNewFile = 'drives:create-new-file' ;
1415}
1516
1617/**
You can’t perform that action at this time.
0 commit comments