Renaming setting names

This commit is contained in:
Matt Bierner 2019-09-10 16:20:01 -07:00
parent 728ee3aa73
commit 28c5988f47
3 changed files with 17 additions and 12 deletions

View file

@ -269,18 +269,18 @@
"%configuration.markdown.preview.openMarkdownLinks.inEditor%"
]
},
"markdown.editor.openMarkdownLinks": {
"markdown.links.openLocation": {
"type": "string",
"default": "currentGroup",
"description": "%configuration.markdown.editor.openMarkdownLinks.description%",
"description": "%configuration.markdown.links.openLocation.description%",
"scope": "resource",
"enum": [
"currentGroup",
"openToSide"
"beside"
],
"enumDescriptions": [
"%configuration.markdown.editor.openMarkdownLinks.inCurrentGroup%",
"%configuration.markdown.editor.openMarkdownLinks.openToSide%"
"%configuration.markdown.links.openLocation.currentGroup%",
"%configuration.markdown.links.openLocation.beside%"
]
},
"markdown.trace": {

View file

@ -21,10 +21,10 @@
"markdown.trace.desc": "Enable debug logging for the markdown extension.",
"markdown.preview.refresh.title": "Refresh Preview",
"markdown.preview.toggleLock.title": "Toggle Preview Locking",
"configuration.markdown.preview.openMarkdownLinks.description": "How should clicking on links to markdown files be handled in the preview.",
"configuration.markdown.preview.openMarkdownLinks.description": "Controls how links to other markdown files in the markdown preview should be opened.",
"configuration.markdown.preview.openMarkdownLinks.inEditor": "Try to open links in the editor",
"configuration.markdown.preview.openMarkdownLinks.inPreview": "Try to open links in the markdown preview",
"configuration.markdown.editor.openMarkdownLinks.description": "How following links to markdown files be handled in the editor.",
"configuration.markdown.editor.openMarkdownLinks.inCurrentGroup": "Try to open links in the current editor group",
"configuration.markdown.editor.openMarkdownLinks.openToSide": "Try to open links to the Side"
"configuration.markdown.links.openLocation.description": "Controls where links in markdown files should be opened.",
"configuration.markdown.links.openLocation.currentGroup": "Open links in the active editor group.",
"configuration.markdown.links.openLocation.beside": "Open links beside the active editor."
}

View file

@ -17,6 +17,11 @@ export interface OpenDocumentLinkArgs {
fragment: string;
}
enum OpenMarkdownLinks {
beside = 'beside',
currentGroup = 'currentGroup',
}
export class OpenDocumentLinkCommand implements Command {
private static readonly id = '_markdown.openDocumentLink';
public readonly id = OpenDocumentLinkCommand.id;
@ -61,11 +66,11 @@ export class OpenDocumentLinkCommand implements Command {
private getViewColumn(resource: vscode.Uri): vscode.ViewColumn {
const config = vscode.workspace.getConfiguration('markdown', resource);
const openLinks = config.get<string>('editor.openMarkdownLinks', 'currentGroup');
const openLinks = config.get<OpenMarkdownLinks>('links.openLocation', OpenMarkdownLinks.currentGroup);
switch (openLinks) {
case 'openToSide':
case OpenMarkdownLinks.beside:
return vscode.ViewColumn.Beside;
case 'currentGroup':
case OpenMarkdownLinks.currentGroup:
default:
return vscode.ViewColumn.Active;
}