Skip to content

Commit

Permalink
Automatically remove editors for deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Mar 8, 2022
1 parent 9e89964 commit cf6a742
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import { SaveAsSketch } from './contributions/save-as-sketch';
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
import { IDEUpdaterDialog } from './dialogs/ide-updater/ide-updater-dialog';
import { IDEUpdater } from '../common/protocol/ide-updater';
import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution';

const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages';
export const SKIP_IDE_VERSION = 'skipIDEVersion';
Expand Down Expand Up @@ -159,6 +160,9 @@ export class ArduinoFrontendContribution
@inject(LocalStorageService)
protected readonly localStorageService: LocalStorageService;

@inject(FileSystemFrontendContribution)
protected readonly fileSystemFrontendContribution: FileSystemFrontendContribution;

@inject(IDEUpdater)
protected readonly updater: IDEUpdater;

Expand Down Expand Up @@ -337,6 +341,12 @@ export class ArduinoFrontendContribution
});

app.shell.leftPanelHandler.removeBottomMenu('settings-menu');

this.fileSystemFrontendContribution.onDidChangeEditorFile(e => {
if (e.type === FileChangeType.DELETED) {
e.editor.close();
}
});
}

onStop(): void {
Expand Down

0 comments on commit cf6a742

Please sign in to comment.