@@ -16,7 +16,7 @@ import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
1616import { IThemeService , registerThemingParticipant , Themable } from 'vs/platform/theme/common/themeService' ;
1717import { editorBackground , contrastBorder } from 'vs/platform/theme/common/colorRegistry' ;
1818import { EDITOR_GROUP_HEADER_TABS_BACKGROUND , EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND , EDITOR_GROUP_EMPTY_BACKGROUND , EDITOR_GROUP_FOCUSED_EMPTY_BORDER , EDITOR_GROUP_HEADER_BORDER } from 'vs/workbench/common/theme' ;
19- import { IMoveEditorOptions , ICopyEditorOptions , ICloseEditorsFilter , IGroupChangeEvent , GroupChangeKind , GroupsOrder , ICloseEditorOptions , ICloseAllEditorsOptions } from 'vs/workbench/services/editor/common/editorGroupsService' ;
19+ import { IMoveEditorOptions , ICopyEditorOptions , ICloseEditorsFilter , IGroupChangeEvent , GroupChangeKind , GroupsOrder , ICloseEditorOptions , ICloseAllEditorsOptions , OpenEditorInGroupContext } from 'vs/workbench/services/editor/common/editorGroupsService' ;
2020import { TabsTitleControl } from 'vs/workbench/browser/parts/editor/tabsTitleControl' ;
2121import { EditorControl } from 'vs/workbench/browser/parts/editor/editorControl' ;
2222import { IEditorProgressService } from 'vs/platform/progress/common/progress' ;
@@ -863,15 +863,15 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
863863
864864 //#region openEditor()
865865
866- async openEditor ( editor : EditorInput , options ?: EditorOptions ) : Promise < IEditorPane | null > {
866+ async openEditor ( editor : EditorInput , options ?: EditorOptions , context ?: OpenEditorInGroupContext ) : Promise < IEditorPane | null > {
867867
868868 // Guard against invalid inputs
869869 if ( ! editor ) {
870870 return null ;
871871 }
872872
873873 // Editor opening event allows for prevention
874- const event = new EditorOpeningEvent ( this . _group . id , editor , options ) ;
874+ const event = new EditorOpeningEvent ( this . _group . id , editor , options , context ) ;
875875 this . _onWillOpenEditor . fire ( event ) ;
876876 const prevented = event . isPrevented ( ) ;
877877 if ( prevented ) {
@@ -1168,7 +1168,6 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
11681168 ...moveOptions ,
11691169 pinned : true , // always pin moved editor
11701170 sticky : this . _group . isSticky ( editor ) , // preserve sticky state,
1171- shouldCreateNewWhenOverride : keepCopy
11721171 } ) ) ;
11731172
11741173 // A move to another group is an open first...
@@ -1718,7 +1717,8 @@ class EditorOpeningEvent implements IEditorOpeningEvent {
17181717 constructor (
17191718 private _group : GroupIdentifier ,
17201719 private _editor : EditorInput ,
1721- private _options : EditorOptions | undefined
1720+ private _options : EditorOptions | undefined ,
1721+ private _context : OpenEditorInGroupContext | undefined
17221722 ) {
17231723 }
17241724
@@ -1734,6 +1734,10 @@ class EditorOpeningEvent implements IEditorOpeningEvent {
17341734 return this . _options ;
17351735 }
17361736
1737+ get context ( ) : OpenEditorInGroupContext | undefined {
1738+ return this . _context ;
1739+ }
1740+
17371741 prevent ( callback : ( ) => Promise < IEditorPane | undefined > ) : void {
17381742 this . override = callback ;
17391743 }
0 commit comments