mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 03:46:33 +00:00
Fix editor tabs order (#612)
This commit is contained in:
parent
13734a642c
commit
9863dc2f90
@ -508,7 +508,6 @@ export class ArduinoFrontendContribution
|
||||
for (const uri of [mainFileUri, ...rootFolderFileUris]) {
|
||||
await this.ensureOpened(uri);
|
||||
}
|
||||
await this.ensureOpened(mainFileUri, true);
|
||||
if (mainFileUri.endsWith('.pde')) {
|
||||
const message = nls.localize(
|
||||
'arduino/common/oldFormat',
|
||||
|
@ -35,13 +35,18 @@ export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
|
||||
|
||||
const layoutData = await this.inflate(serializedLayoutData);
|
||||
// workaround to remove duplicated tabs
|
||||
const filesUri: string[] = [];
|
||||
if ((layoutData as any)?.mainPanel?.main?.widgets) {
|
||||
(layoutData as any).mainPanel.main.widgets = (
|
||||
layoutData as any
|
||||
).mainPanel.main.widgets.filter(
|
||||
(widget: any) =>
|
||||
widget.constructionOptions.factoryId !== 'code-editor-opener'
|
||||
);
|
||||
).mainPanel.main.widgets.filter((widget: any) => {
|
||||
const uri = widget.getResourceUri().toString();
|
||||
if (filesUri.includes(uri)) {
|
||||
return false;
|
||||
}
|
||||
filesUri.push(uri);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
await app.shell.setLayoutData(layoutData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user