@@ -10,14 +10,15 @@ import { EditorResourceAccessor, GroupModelChangeKind, SideBySideEditor } from '
10
10
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput' ;
11
11
import { EditorInput } from 'vs/workbench/common/editor/editorInput' ;
12
12
import { columnToEditorGroup , EditorGroupColumn , editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn' ;
13
- import { GroupDirection , IEditorGroup , IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService' ;
14
- import { IEditorsChangeEvent , IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
13
+ import { GroupDirection , IEditorGroup , IEditorGroupsService , preferredSideBySideGroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService' ;
14
+ import { IEditorsChangeEvent , IEditorService , SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService' ;
15
15
import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput' ;
16
16
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput' ;
17
17
import { CustomEditorInput } from 'vs/workbench/contrib/customEditor/browser/customEditorInput' ;
18
18
import { URI } from 'vs/base/common/uri' ;
19
19
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput' ;
20
20
import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput' ;
21
+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
21
22
22
23
23
24
interface TabInfo {
@@ -40,6 +41,7 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape {
40
41
constructor (
41
42
extHostContext : IExtHostContext ,
42
43
@IEditorGroupsService private readonly _editorGroupsService : IEditorGroupsService ,
44
+ @IConfigurationService private readonly _configurationService : IConfigurationService ,
43
45
@IEditorService editorService : IEditorService ,
44
46
) {
45
47
@@ -444,7 +446,12 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape {
444
446
}
445
447
// If group index is out of bounds then we make a new one that's to the right of the last group
446
448
if ( this . _groupLookup . get ( groupId ) === undefined ) {
447
- targetGroup = this . _editorGroupsService . addGroup ( this . _editorGroupsService . groups [ this . _editorGroupsService . groups . length - 1 ] , GroupDirection . RIGHT , undefined ) ;
449
+ let direction = GroupDirection . RIGHT ;
450
+ // Make sure we respect the user's preferred side direction
451
+ if ( viewColumn === SIDE_GROUP ) {
452
+ direction = preferredSideBySideGroupDirection ( this . _configurationService ) ;
453
+ }
454
+ targetGroup = this . _editorGroupsService . addGroup ( this . _editorGroupsService . groups [ this . _editorGroupsService . groups . length - 1 ] , direction , undefined ) ;
448
455
} else {
449
456
targetGroup = this . _editorGroupsService . getGroup ( groupId ) ;
450
457
}
0 commit comments