File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
arduino-ide-extension/src/browser Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -508,7 +508,6 @@ export class ArduinoFrontendContribution
508508 for ( const uri of [ mainFileUri , ...rootFolderFileUris ] ) {
509509 await this . ensureOpened ( uri ) ;
510510 }
511- await this . ensureOpened ( mainFileUri , true ) ;
512511 if ( mainFileUri . endsWith ( '.pde' ) ) {
513512 const message = nls . localize (
514513 'arduino/common/oldFormat' ,
Original file line number Diff line number Diff line change @@ -35,13 +35,18 @@ export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
3535
3636 const layoutData = await this . inflate ( serializedLayoutData ) ;
3737 // workaround to remove duplicated tabs
38+ const filesUri : string [ ] = [ ] ;
3839 if ( ( layoutData as any ) ?. mainPanel ?. main ?. widgets ) {
3940 ( layoutData as any ) . mainPanel . main . widgets = (
4041 layoutData as any
41- ) . mainPanel . main . widgets . filter (
42- ( widget : any ) =>
43- widget . constructionOptions . factoryId !== 'code-editor-opener'
44- ) ;
42+ ) . mainPanel . main . widgets . filter ( ( widget : any ) => {
43+ const uri = widget . getResourceUri ( ) . toString ( ) ;
44+ if ( filesUri . includes ( uri ) ) {
45+ return false ;
46+ }
47+ filesUri . push ( uri ) ;
48+ return true ;
49+ } ) ;
4550 }
4651
4752 await app . shell . setLayoutData ( layoutData ) ;
You can’t perform that action at this time.
0 commit comments