Skip to content

Commit cf6a742

Browse files
committed
Automatically remove editors for deleted files
1 parent 9e89964 commit cf6a742

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import { SaveAsSketch } from './contributions/save-as-sketch';
7070
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
7171
import { IDEUpdaterDialog } from './dialogs/ide-updater/ide-updater-dialog';
7272
import { IDEUpdater } from '../common/protocol/ide-updater';
73+
import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution';
7374

7475
const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages';
7576
export const SKIP_IDE_VERSION = 'skipIDEVersion';
@@ -159,6 +160,9 @@ export class ArduinoFrontendContribution
159160
@inject(LocalStorageService)
160161
protected readonly localStorageService: LocalStorageService;
161162

163+
@inject(FileSystemFrontendContribution)
164+
protected readonly fileSystemFrontendContribution: FileSystemFrontendContribution;
165+
162166
@inject(IDEUpdater)
163167
protected readonly updater: IDEUpdater;
164168

@@ -337,6 +341,12 @@ export class ArduinoFrontendContribution
337341
});
338342

339343
app.shell.leftPanelHandler.removeBottomMenu('settings-menu');
344+
345+
this.fileSystemFrontendContribution.onDidChangeEditorFile(e => {
346+
if (e.type === FileChangeType.DELETED) {
347+
e.editor.close();
348+
}
349+
});
340350
}
341351

342352
onStop(): void {

0 commit comments

Comments
 (0)