File tree Expand file tree Collapse file tree 6 files changed +312
-475
lines changed Expand file tree Collapse file tree 6 files changed +312
-475
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,20 @@ function activate(
157157 tracker . currentWidget !== null &&
158158 tracker . currentWidget === app . shell . currentWidget ,
159159 execute : ( ) => {
160- const cwd = browserFactory . defaultBrowser . model . path ;
160+ const wdg = app . shell . currentWidget as DrawIODocumentWidget ;
161+ const name = wdg . context . path . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] + ".svg" ;
162+ let path = wdg . context . path . split ( '/' ) . slice ( 0 , - 1 ) . join ( ) ;
163+
161164 commands
162165 . execute ( 'docmanager:new-untitled' , {
163- path : cwd ,
166+ name,
167+ path,
164168 type : 'file' ,
165169 ext : '.svg'
166170 } )
167- . then ( model => {
168- const wdg = app . shell . currentWidget as any ;
171+ . then ( model => {
172+ model . name = name
173+ model . path = path ? path + "/" + name : name ;
169174 model . content = wdg . getSVG ( ) ;
170175 model . format = 'text' ;
171176 app . serviceManager . contents . save ( model . path , model ) ;
You can’t perform that action at this time.
0 commit comments