File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/vs/workbench/browser/parts/editor Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
281
281
} ;
282
282
283
283
// Update group contexts based on group changes
284
- this . _register ( this . onDidModelChange ( e => {
284
+ const updateGroupContextKeys = ( e : IGroupModelChangeEvent ) => {
285
285
switch ( e . kind ) {
286
286
case GroupModelChangeKind . GROUP_LOCKED :
287
287
groupLockedContext . set ( this . isLocked ) ;
@@ -312,16 +312,18 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
312
312
313
313
// Group editors count context
314
314
groupEditorsCountContext . set ( this . count ) ;
315
- } ) ) ;
315
+ } ;
316
+
317
+ this . _register ( this . onDidModelChange ( e => updateGroupContextKeys ( e ) ) ) ;
316
318
317
319
// Track the active editor and update context key that reflects
318
320
// the dirty state of this editor
319
- this . _register ( this . onDidActiveEditorChange ( ( ) => {
320
- observeActiveEditor ( ) ;
321
- } ) ) ;
321
+ this . _register ( this . onDidActiveEditorChange ( ( ) => observeActiveEditor ( ) ) ) ;
322
322
323
323
// Update context keys on startup
324
324
observeActiveEditor ( ) ;
325
+ updateGroupContextKeys ( { kind : GroupModelChangeKind . EDITOR_ACTIVE } ) ;
326
+ updateGroupContextKeys ( { kind : GroupModelChangeKind . GROUP_LOCKED } ) ;
325
327
}
326
328
327
329
private registerContainerListeners ( ) : void {
You can’t perform that action at this time.
0 commit comments