提交 728ee3aa 编写于 作者: M Matt Bierner

Extract

上级 c307d736
......@@ -53,22 +53,22 @@ export class OpenDocumentLinkCommand implements Command {
}
}
const column = this.getViewColumn(resource);
return vscode.workspace.openTextDocument(resource)
.then(document => vscode.window.showTextDocument(document, column))
.then(editor => this.tryRevealLine(editor, args.fragment));
}
private getViewColumn(resource: vscode.Uri): vscode.ViewColumn {
const config = vscode.workspace.getConfiguration('markdown', resource);
const openLinks = config.get<string>('editor.openMarkdownLinks', 'currentGroup');
let column: vscode.ViewColumn;
switch (openLinks) {
case 'openToSide':
column = vscode.ViewColumn.Beside;
break;
return vscode.ViewColumn.Beside;
case 'currentGroup':
default:
column = vscode.ViewColumn.Active;
return vscode.ViewColumn.Active;
}
return vscode.workspace.openTextDocument(resource)
.then(document => vscode.window.showTextDocument(document, column))
.then(editor => this.tryRevealLine(editor, args.fragment));
}
private async tryRevealLine(editor: vscode.TextEditor, fragment?: string) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册