File tree Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,13 @@ const extension: JupyterFrontEndPlugin<void> = {
98
98
tracker . save ( widget ) ;
99
99
} ) ;
100
100
tracker . add ( widget ) ;
101
+
102
+ // Open editor alongside viewer
103
+ commands . execute ( 'docmanager:open' , {
104
+ path : widget . context . path ,
105
+ factory : 'Editor'
106
+ } ) ;
107
+
101
108
} ) ;
102
109
103
110
// Register widget and model factories
@@ -121,20 +128,23 @@ const extension: JupyterFrontEndPlugin<void> = {
121
128
icon : urdf_icon ,
122
129
iconClass : 'jp-URDFIcon' ,
123
130
caption : 'Create a new URDF' ,
124
- execute : ( ) => {
131
+ execute : async ( ) => {
125
132
const cwd = browserFactory . model . path ;
126
- commands
127
- . execute ( 'docmanager:new-untitled' , {
128
- path : cwd ,
129
- type : 'file' ,
130
- ext : '.urdf'
131
- } )
132
- . then ( model =>
133
- commands . execute ( 'docmanager:open' , {
134
- path : model . path ,
135
- factory : FACTORY
136
- } )
137
- ) ;
133
+ const model = await commands . execute ( 'docmanager:new-untitled' , {
134
+ path : cwd ,
135
+ type : 'file' ,
136
+ ext : '.urdf'
137
+ } ) ;
138
+
139
+ await commands . execute ( 'docmanager:open' , {
140
+ path : model . path ,
141
+ factory : FACTORY
142
+ } ) ;
143
+
144
+ await commands . execute ( 'docmanager:open' , {
145
+ path : model . path ,
146
+ factory : 'Editor'
147
+ } ) ;
138
148
}
139
149
} ) ;
140
150
You can’t perform that action at this time.
0 commit comments