File tree 2 files changed +9
-5
lines changed
arduino-ide-extension/src/browser
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -508,7 +508,6 @@ export class ArduinoFrontendContribution
508
508
for ( const uri of [ mainFileUri , ...rootFolderFileUris ] ) {
509
509
await this . ensureOpened ( uri ) ;
510
510
}
511
- await this . ensureOpened ( mainFileUri , true ) ;
512
511
if ( mainFileUri . endsWith ( '.pde' ) ) {
513
512
const message = nls . localize (
514
513
'arduino/common/oldFormat' ,
Original file line number Diff line number Diff line change @@ -35,13 +35,18 @@ export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
35
35
36
36
const layoutData = await this . inflate ( serializedLayoutData ) ;
37
37
// workaround to remove duplicated tabs
38
+ const filesUri : string [ ] = [ ] ;
38
39
if ( ( layoutData as any ) ?. mainPanel ?. main ?. widgets ) {
39
40
( layoutData as any ) . mainPanel . main . widgets = (
40
41
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
+ } ) ;
45
50
}
46
51
47
52
await app . shell . setLayoutData ( layoutData ) ;
You can’t perform that action at this time.
0 commit comments