mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
* Fix for #26659. Clicking on a local file link will open up the editor on a separate editor group (new or reuse existing one). * Fix for #26659: Add way to open Markdown links in a different editor group Adding "markdown.editor.openMarkdownLinks" setting to specify where links to markdown files should open (current editor group by default).
This commit is contained in:
committed by
Matt Bierner
parent
db9733d1e3
commit
c307d73664
@@ -52,8 +52,22 @@ export class OpenDocumentLinkCommand implements Command {
|
||||
return this.tryRevealLine(vscode.window.activeTextEditor, args.fragment);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
case 'currentGroup':
|
||||
default:
|
||||
column = vscode.ViewColumn.Active;
|
||||
}
|
||||
|
||||
return vscode.workspace.openTextDocument(resource)
|
||||
.then(vscode.window.showTextDocument)
|
||||
.then(document => vscode.window.showTextDocument(document, column))
|
||||
.then(editor => this.tryRevealLine(editor, args.fragment));
|
||||
}
|
||||
|
||||
@@ -107,4 +121,4 @@ async function tryResolveLinkToMarkdownFile(path: string): Promise<vscode.Uri |
|
||||
return document.uri;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user