diff --git a/package.json b/package.json index b0689ca95..ae19724df 100644 --- a/package.json +++ b/package.json @@ -1544,6 +1544,11 @@ "default": true, "markdownDescription": "Enable automatic refresh of R Markdown preview on file update." }, + "r.rmarkdown.preview.zoom": { + "type": "number", + "default": 1, + "markdownDescription": "Controls the zoom of the R Markdown preview." + }, "r.rmarkdown.knit.useBackgroundProcess": { "type": "boolean", "default": true, diff --git a/src/rmarkdown/preview.ts b/src/rmarkdown/preview.ts index eb5efb79b..b9d5984d6 100644 --- a/src/rmarkdown/preview.ts +++ b/src/rmarkdown/preview.ts @@ -87,8 +87,11 @@ class RMarkdownPreview extends vscode.Disposable { const $ = cheerio.load(content); this.htmlLightContent = $.html(); + const zoom = config().get('rmarkdown.preview.zoom', 1); + // make the output chunks a little lighter to stand out let chunkCol = String(config().get('rmarkdown.chunkBackgroundColor')); + let outCol: string; if (chunkCol) { const colReg = /[0-9.]+/g; @@ -106,6 +109,7 @@ class RMarkdownPreview extends vscode.Disposable { const style = `