File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
apps/vscode/src/providers/editor Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -165,15 +165,12 @@ export class VisualEditorProvider implements CustomTextEditorProvider {
165165 }
166166
167167 if ( editorMode && editorMode != viewType && ! isSwitch ) {
168- const allTabs = window . tabGroups . all ?. [ 0 ] ? .tabs ;
168+ const allTabs = window . tabGroups . all . flatMap ( group => group . tabs ) ;
169169
170- // find tab to close if swapping editor type. we don't want to close an active
171- // tab since a tab we are opening has not been set as active yet. we also don't
172- // want to close preview tabs since they will automatically be overriden
170+ // find tab to close if swapping editor type
173171 const tabsToClose = allTabs . filter ( tab =>
174172 ( ( tab . input instanceof TabInputText ) || ( tab . input instanceof TabInputCustom ) ) &&
175- ( tab . input ?. uri ?. toString ( ) === uri ?. toString ( ) ) &&
176- ( tab . isActive == false || tab . isPreview == true )
173+ ( tab . input ?. uri ?. toString ( ) === uri ?. toString ( ) )
177174 ) ;
178175
179176 await window . tabGroups . close ( tabsToClose , true ) ;
You can’t perform that action at this time.
0 commit comments