mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 05:36:37 +00:00
parent
d576523abb
commit
d2d9072c91
|
@ -9,7 +9,7 @@ import { GroupIdentifier, CloseDirection, IEditorCloseEvent, IEditorPane, SaveRe
|
|||
import { ActiveEditorGroupLockedContext, ActiveEditorDirtyContext, EditorGroupEditorsCountContext, ActiveEditorStickyContext, ActiveEditorPinnedContext, ActiveEditorLastInGroupContext, ActiveEditorFirstInGroupContext, EditorPinnedAndUnpinnedTabsContext, ResourceContextKey, applyAvailableEditorIds, ActiveEditorAvailableEditorIdsContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext } from 'vs/workbench/common/contextkeys';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput';
|
||||
import { Emitter, Relay, Event } from 'vs/base/common/event';
|
||||
import { Emitter, Relay } from 'vs/base/common/event';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Dimension, trackFocus, addDisposableListener, EventType, EventHelper, findParentWithClass, isAncestor, IDomNodePagePosition, isMouseEvent, isActiveElement, focusWindow } from 'vs/base/browser/dom';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
|
@ -1915,7 +1915,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
|
|||
const primary: IAction[] = [];
|
||||
const secondary: IAction[] = [];
|
||||
|
||||
let onDidChange = Event.None;
|
||||
let onDidChange;
|
||||
|
||||
// Editor actions require the editor control to be there, so we retrieve it via service
|
||||
const activeEditorPane = this.activeEditorPane;
|
||||
|
@ -1933,6 +1933,12 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
|
|||
'navigation',
|
||||
shouldInlineGroup
|
||||
);
|
||||
} else {
|
||||
// If there is no active pane in the group (it's the last group and it's empty)
|
||||
// Trigger the change event when the active editor changes
|
||||
const _onDidChange = new Emitter<void>();
|
||||
onDidChange = _onDidChange.event;
|
||||
disposables.add(this.onDidActiveEditorChange(() => _onDidChange.fire()));
|
||||
}
|
||||
|
||||
return { actions: { primary, secondary }, onDidChange };
|
||||
|
|
|
@ -514,7 +514,7 @@ export const enum OpenEditorContext {
|
|||
|
||||
export interface IActiveEditorActions {
|
||||
readonly actions: IToolbarActions;
|
||||
readonly onDidChange: Event<IMenuChangeEvent>;
|
||||
readonly onDidChange: Event<IMenuChangeEvent | void>;
|
||||
}
|
||||
|
||||
export interface IEditorGroup {
|
||||
|
|
Loading…
Reference in a new issue