mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
Re-render markdown preview when linkify setting changes (#200599)
This commit is contained in:
@@ -7,13 +7,17 @@ import * as vscode from 'vscode';
|
||||
import { equals } from '../util/arrays';
|
||||
|
||||
export class MarkdownPreviewConfiguration {
|
||||
public static getForResource(resource: vscode.Uri) {
|
||||
public static getForResource(resource: vscode.Uri | null) {
|
||||
return new MarkdownPreviewConfiguration(resource);
|
||||
}
|
||||
|
||||
public readonly scrollBeyondLastLine: boolean;
|
||||
public readonly wordWrap: boolean;
|
||||
public readonly lineBreaks: boolean;
|
||||
|
||||
public readonly previewLineBreaks: boolean;
|
||||
public readonly previewLinkify: boolean;
|
||||
public readonly previewTypographer: boolean;
|
||||
|
||||
public readonly doubleClickToSwitchToEditor: boolean;
|
||||
public readonly scrollEditorWithPreview: boolean;
|
||||
public readonly scrollPreviewWithEditor: boolean;
|
||||
@@ -24,7 +28,7 @@ export class MarkdownPreviewConfiguration {
|
||||
public readonly fontFamily: string | undefined;
|
||||
public readonly styles: readonly string[];
|
||||
|
||||
private constructor(resource: vscode.Uri) {
|
||||
private constructor(resource: vscode.Uri | null) {
|
||||
const editorConfig = vscode.workspace.getConfiguration('editor', resource);
|
||||
const markdownConfig = vscode.workspace.getConfiguration('markdown', resource);
|
||||
const markdownEditorConfig = vscode.workspace.getConfiguration('[markdown]', resource);
|
||||
@@ -38,7 +42,11 @@ export class MarkdownPreviewConfiguration {
|
||||
|
||||
this.scrollPreviewWithEditor = !!markdownConfig.get<boolean>('preview.scrollPreviewWithEditor', true);
|
||||
this.scrollEditorWithPreview = !!markdownConfig.get<boolean>('preview.scrollEditorWithPreview', true);
|
||||
this.lineBreaks = !!markdownConfig.get<boolean>('preview.breaks', false);
|
||||
|
||||
this.previewLineBreaks = !!markdownConfig.get<boolean>('preview.breaks', false);
|
||||
this.previewLinkify = !!markdownConfig.get<boolean>('preview.linkify', true);
|
||||
this.previewTypographer = !!markdownConfig.get<boolean>('preview.typographer', false);
|
||||
|
||||
this.doubleClickToSwitchToEditor = !!markdownConfig.get<boolean>('preview.doubleClickToSwitchToEditor', true);
|
||||
this.markEditorSelection = !!markdownConfig.get<boolean>('preview.markEditorSelection', true);
|
||||
|
||||
@@ -61,7 +69,7 @@ export class MarkdownPreviewConfiguration {
|
||||
return equals(this.styles, otherConfig.styles);
|
||||
}
|
||||
|
||||
[key: string]: any;
|
||||
readonly [key: string]: any;
|
||||
}
|
||||
|
||||
export class MarkdownPreviewConfigurationManager {
|
||||
|
||||
Reference in New Issue
Block a user