@@ -1133,10 +1133,13 @@ export class OpenNextEditor extends AbstractNavigateEditorAction {
1133
1133
}
1134
1134
1135
1135
// Otherwise try in next group that has editors
1136
+ const handledGroups = new Set < number > ( ) ;
1136
1137
let currentGroup : IEditorGroup | undefined = this . editorGroupService . activeGroup ;
1137
- while ( currentGroup ) {
1138
+ while ( currentGroup && ! handledGroups . has ( currentGroup . id ) ) {
1138
1139
currentGroup = this . editorGroupService . findGroup ( { location : GroupLocation . NEXT } , currentGroup , true ) ;
1139
1140
if ( currentGroup ) {
1141
+ handledGroups . add ( currentGroup . id ) ;
1142
+
1140
1143
const groupEditors = currentGroup . getEditors ( EditorsOrder . SEQUENTIAL ) ;
1141
1144
if ( groupEditors . length > 0 ) {
1142
1145
return { editor : groupEditors [ 0 ] , groupId : currentGroup . id } ;
@@ -1173,10 +1176,13 @@ export class OpenPreviousEditor extends AbstractNavigateEditorAction {
1173
1176
}
1174
1177
1175
1178
// Otherwise try in previous group that has editors
1179
+ const handledGroups = new Set < number > ( ) ;
1176
1180
let currentGroup : IEditorGroup | undefined = this . editorGroupService . activeGroup ;
1177
- while ( currentGroup ) {
1181
+ while ( currentGroup && ! handledGroups . has ( currentGroup . id ) ) {
1178
1182
currentGroup = this . editorGroupService . findGroup ( { location : GroupLocation . PREVIOUS } , currentGroup , true ) ;
1179
1183
if ( currentGroup ) {
1184
+ handledGroups . add ( currentGroup . id ) ;
1185
+
1180
1186
const groupEditors = currentGroup . getEditors ( EditorsOrder . SEQUENTIAL ) ;
1181
1187
if ( groupEditors . length > 0 ) {
1182
1188
return { editor : groupEditors [ groupEditors . length - 1 ] , groupId : currentGroup . id } ;
0 commit comments