Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Issue 6955 - workbench.action.closeActiveEditor command #6978

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { ApplicationShellMouseTracker } from '@theia/core/lib/browser/shell/appl
import { CommandService } from '@theia/core/lib/common/command';
import TheiaURI from '@theia/core/lib/common/uri';
import { EditorManager } from '@theia/editor/lib/browser';
import { CodeEditorWidget } from '@theia/plugin-ext/lib/main/browser/menus/menus-contribution-handler';
import { TextDocumentShowOptions } from '@theia/plugin-ext/lib/common/plugin-api-rpc-model';
import { DocumentsMainImpl } from '@theia/plugin-ext/lib/main/browser/documents-main';
import { createUntitledResource } from '@theia/plugin-ext/lib/main/browser/editor/untitled-resource';
Expand Down Expand Up @@ -231,7 +232,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
return (resourceUri && resourceUri.toString()) === uriString;
});
}
if (NavigatableWidget.is(widget)) {
if (CodeEditorWidget.is(widget)) {
widget.close();
}
}
Expand All @@ -247,7 +248,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
});
}
for (const widget of this.shell.widgets) {
if (NavigatableWidget.is(widget) && widget !== editor) {
if (CodeEditorWidget.is(widget) && widget !== editor) {
widget.close();
}
}
Expand All @@ -267,7 +268,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
const tabBar = this.shell.getTabBarFor(editor);
if (tabBar) {
this.shell.closeTabs(tabBar,
({ owner }) => NavigatableWidget.is(owner) && owner !== editor
({ owner }) => CodeEditorWidget.is(owner) && owner !== editor
);
}
}
Expand All @@ -281,7 +282,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
for (const tabBar of this.shell.allTabBars) {
if (tabBar !== editorTabBar) {
this.shell.closeTabs(tabBar,
({ owner }) => NavigatableWidget.is(owner)
({ owner }) => CodeEditorWidget.is(owner)
);
}
}
Expand All @@ -301,7 +302,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
left = false;
return false;
}
return left && NavigatableWidget.is(owner);
return left && CodeEditorWidget.is(owner);
}
);
}
Expand All @@ -321,7 +322,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
left = false;
return false;
}
return !left && NavigatableWidget.is(owner);
return !left && CodeEditorWidget.is(owner);
}
);
}
Expand All @@ -331,7 +332,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
commands.registerCommand({ id: 'workbench.action.closeAllEditors' }, {
execute: () => {
for (const widget of this.shell.widgets) {
if (NavigatableWidget.is(widget)) {
if (CodeEditorWidget.is(widget)) {
widget.close();
}
}
Expand Down