File tree Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -157,27 +157,15 @@ function activate(
157
157
tracker . currentWidget !== null &&
158
158
tracker . currentWidget === app . shell . currentWidget ,
159
159
execute : ( ) => {
160
- const wdg = app . shell . currentWidget as DrawIODocumentWidget ;
161
- const name =
162
- wdg . context . path
163
- . split ( '/' )
164
- . pop ( )
165
- . split ( '.' ) [ 0 ] + '.svg' ;
166
- const path = wdg . context . path
167
- . split ( '/' )
168
- . slice ( 0 , - 1 )
169
- . join ( ) ;
170
-
160
+ const cwd = browserFactory . defaultBrowser . model . path ;
171
161
commands
172
162
. execute ( 'docmanager:new-untitled' , {
173
- name,
174
- path,
163
+ path : cwd ,
175
164
type : 'file' ,
176
165
ext : '.svg'
177
166
} )
178
167
. then ( model => {
179
- model . name = name ;
180
- model . path = path ? path + '/' + name : name ;
168
+ const wdg = app . shell . currentWidget as any ;
181
169
model . content = wdg . getSVG ( ) ;
182
170
model . format = 'text' ;
183
171
app . serviceManager . contents . save ( model . path , model ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments