@@ -449,6 +449,10 @@ suite('EditorGroupsService', () => {
449449 assert . equal ( editorCloseCounter1 , 1 ) ;
450450 assert . equal ( editorWillCloseCounter , 1 ) ;
451451
452+ assert . ok ( inputInactive . gotClosed ) ;
453+ assert . equal ( inputInactive . gotClosed ?. group , group . id ) ;
454+ assert . equal ( inputInactive . gotClosed ?. openedInOtherGroups , false ) ;
455+
452456 assert . equal ( group . activeEditor , input ) ;
453457
454458 assert . equal ( editorStickyCounter , 0 ) ;
@@ -482,10 +486,44 @@ suite('EditorGroupsService', () => {
482486 assert . equal ( group . getEditorByIndex ( 1 ) , inputInactive ) ;
483487
484488 await group . closeEditors ( [ input , inputInactive ] ) ;
489+
490+ assert . ok ( input . gotClosed ) ;
491+ assert . equal ( input . gotClosed ?. group , group . id ) ;
492+ assert . equal ( input . gotClosed ?. openedInOtherGroups , false ) ;
493+ assert . ok ( inputInactive . gotClosed ) ;
494+ assert . equal ( inputInactive . gotClosed ?. group , group . id ) ;
495+ assert . equal ( inputInactive . gotClosed ?. openedInOtherGroups , false ) ;
496+
485497 assert . equal ( group . isEmpty , true ) ;
486498 part . dispose ( ) ;
487499 } ) ;
488500
501+ test ( 'closeEditors (one, opened in multiple groups)' , async ( ) => {
502+ const [ part ] = createPart ( ) ;
503+ const group = part . activeGroup ;
504+ assert . equal ( group . isEmpty , true ) ;
505+
506+ const rightGroup = part . addGroup ( group , GroupDirection . RIGHT ) ;
507+
508+ const input = new TestFileEditorInput ( URI . file ( 'foo/bar' ) , TEST_EDITOR_INPUT_ID ) ;
509+ const inputInactive = new TestFileEditorInput ( URI . file ( 'foo/bar/inactive' ) , TEST_EDITOR_INPUT_ID ) ;
510+
511+ await group . openEditors ( [ { editor : input , options : { pinned : true } } , { editor : inputInactive } ] ) ;
512+ await rightGroup . openEditors ( [ { editor : input , options : { pinned : true } } , { editor : inputInactive } ] ) ;
513+
514+ await rightGroup . closeEditor ( input ) ;
515+
516+ assert . ok ( input . gotClosed ) ;
517+ assert . equal ( input . gotClosed ?. group , rightGroup . id ) ;
518+ assert . equal ( input . gotClosed ?. openedInOtherGroups , true ) ;
519+
520+ await group . closeEditor ( input ) ;
521+
522+ assert . ok ( input . gotClosed ) ;
523+ assert . equal ( input . gotClosed ?. group , group . id ) ;
524+ assert . equal ( input . gotClosed ?. openedInOtherGroups , false ) ;
525+ } ) ;
526+
489527 test ( 'closeEditors (except one)' , async ( ) => {
490528 const [ part ] = createPart ( ) ;
491529 const group = part . activeGroup ;
0 commit comments