* 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:
Salvador Cabrera Lozano
2019-09-10 17:58:27 -05:00
committed by Matt Bierner
parent db9733d1e3
commit c307d73664
3 changed files with 35 additions and 4 deletions

View File

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