11import type { TextDocument , TextDocumentShowOptions , TextEditor } from 'vscode' ;
2- import { Uri , ViewColumn , window , workspace } from 'vscode' ;
2+ import { Uri , ViewColumn , window } from 'vscode' ;
33import { imageMimetypes , Schemes } from '../../../constants' ;
44import { isGitUri } from '../../../git/gitUri' ;
55import { Logger } from '../../logger' ;
@@ -184,6 +184,7 @@ export async function openSettingsEditor(queryOrOptions: OpenSettingsEditorOptio
184184export async function openTextEditor (
185185 uri : Uri ,
186186 options ?: TextDocumentShowOptions & { background ?: boolean ; throwOnError ?: boolean } ,
187+ title ?: string ,
187188) : Promise < TextEditor | undefined > {
188189 let background ;
189190 let throwOnError ;
@@ -196,14 +197,13 @@ export async function openTextEditor(
196197 uri = uri . documentUri ( ) ;
197198 }
198199
199- if ( background || ( uri . scheme === Schemes . GitLens && imageMimetypes [ extname ( uri . fsPath ) ] ) ) {
200- await executeCoreCommand ( 'vscode.open' , uri , { background : background , ...options } ) ;
200+ if ( background || title || ( uri . scheme === Schemes . GitLens && imageMimetypes [ extname ( uri . fsPath ) ] ) ) {
201+ await executeCoreCommand ( 'vscode.open' , uri , { background : background , ...options } , title ) ;
201202
202203 return undefined ;
203204 }
204205
205- const document = await workspace . openTextDocument ( uri ) ;
206- return await window . showTextDocument ( document , {
206+ return await window . showTextDocument ( uri , {
207207 preserveFocus : false ,
208208 preview : true ,
209209 viewColumn : ViewColumn . Active ,
0 commit comments