소스 검색

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;
}

불러오는 중...
취소
저장