Преглед на файлове

Fixes pinned editor issues

main
Eric Amodio преди 7 години
родител
ревизия
1a244c6296
променени са 1 файла, в които са добавени 6 реда и са изтрити 10 реда
  1. +6
    -10
      src/quickPicks/quickPicks.ts

+ 6
- 10
src/quickPicks/quickPicks.ts Целия файл

@ -10,7 +10,7 @@ export function getQuickPickIgnoreFocusOut() {
export async function openEditor(uri: Uri, pinned: boolean = false) {
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);
return window.showTextDocument(document, (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1, true);
@ -41,16 +41,12 @@ export class OpenFileCommandQuickPickItem extends CommandQuickPickItem {
super(item, undefined, undefined);
}
async execute(): Promise<{}> {
return this.preview();
}
async open(): Promise<TextEditor | undefined> {
return openEditor(this.uri);
async execute(pinned: boolean = false): Promise<{}> {
return this.open(pinned);
}
async preview(): Promise<{}> {
return openEditor(this.uri, true);
async open(pinned: boolean = false): Promise<TextEditor | undefined> {
return openEditor(this.uri, pinned);
}
}
@ -62,7 +58,7 @@ export class OpenFilesCommandQuickPickItem extends CommandQuickPickItem {
async execute(): Promise<{}> {
for (const uri of this.uris) {
openEditor(uri);
openEditor(uri, true);
}
return undefined;
}

Зареждане…
Отказ
Запис