mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Fixes pinned editor issues
This commit is contained in:
@@ -10,7 +10,7 @@ export function getQuickPickIgnoreFocusOut() {
|
|||||||
|
|
||||||
export async function openEditor(uri: Uri, pinned: boolean = false) {
|
export async function openEditor(uri: Uri, pinned: boolean = false) {
|
||||||
try {
|
try {
|
||||||
if (pinned) return await commands.executeCommand(BuiltInCommands.Open, uri);
|
if (!pinned) return await commands.executeCommand(BuiltInCommands.Open, uri);
|
||||||
|
|
||||||
const document = await workspace.openTextDocument(uri);
|
const document = await workspace.openTextDocument(uri);
|
||||||
return window.showTextDocument(document, (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1, true);
|
return window.showTextDocument(document, (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1, true);
|
||||||
@@ -41,16 +41,12 @@ export class OpenFileCommandQuickPickItem extends CommandQuickPickItem {
|
|||||||
super(item, undefined, undefined);
|
super(item, undefined, undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute(): Promise<{}> {
|
async execute(pinned: boolean = false): Promise<{}> {
|
||||||
return this.preview();
|
return this.open(pinned);
|
||||||
}
|
}
|
||||||
|
|
||||||
async open(): Promise<TextEditor | undefined> {
|
async open(pinned: boolean = false): Promise<TextEditor | undefined> {
|
||||||
return openEditor(this.uri);
|
return openEditor(this.uri, pinned);
|
||||||
}
|
|
||||||
|
|
||||||
async preview(): Promise<{}> {
|
|
||||||
return openEditor(this.uri, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +58,7 @@ export class OpenFilesCommandQuickPickItem extends CommandQuickPickItem {
|
|||||||
|
|
||||||
async execute(): Promise<{}> {
|
async execute(): Promise<{}> {
|
||||||
for (const uri of this.uris) {
|
for (const uri of this.uris) {
|
||||||
openEditor(uri);
|
openEditor(uri, true);
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user