diff --git a/extensions/markdown/media/main.js b/extensions/markdown/media/main.js
index fb99d8043f21da309f004b011ba3ecc3c39b586d..39616cc694e6b0d9daa1077b96d1fd524a2f56d7 100644
--- a/extensions/markdown/media/main.js
+++ b/extensions/markdown/media/main.js
@@ -120,7 +120,7 @@
window.onload = () => {
pageHeight = document.body.getBoundingClientRect().height;
- if (window.initialData.enablePreviewSync) {
+ if (window.initialData.scrollPreviewWithEditorSelection) {
const initialLine = +window.initialData.line || 0;
scrollDisabled = true;
scrollToRevealSourceLine(initialLine);
@@ -135,7 +135,7 @@
pageHeight = newPageHeight;
}, true);
- if (window.initialData.enablePreviewSync) {
+ if (window.initialData.scrollPreviewWithEditorSelection) {
window.addEventListener('message', event => {
const line = +event.data.line;
@@ -157,7 +157,7 @@
}
};
- if (window.initialData.enableScrollSync) {
+ if (window.initialData.scrollEditorWithPreview) {
window.onscroll = () => {
if (scrollDisabled) {
scrollDisabled = false;
diff --git a/extensions/markdown/media/markdown.css b/extensions/markdown/media/markdown.css
index b64f3689cf5ca6d6be542c3e932f063bf469c245..a931ffd5452aa6963c039ae026ec945291423ed5 100644
--- a/extensions/markdown/media/markdown.css
+++ b/extensions/markdown/media/markdown.css
@@ -15,12 +15,12 @@ body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
-.code-line {
+body.showEditorSelection .code-line {
position: relative;
}
-.code-active-line:before,
-.code-line:hover:before {
+body.showEditorSelection .code-active-line:before,
+body.showEditorSelection .code-line:hover:before {
content: "";
display: block;
position: absolute;
@@ -29,11 +29,11 @@ body.scrollBeyondLastLine {
height: 100%;
}
-.code-active-line:before {
+body.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 122, 204, 0.5);
}
-.code-line:hover:before {
+body.showEditorSelection .code-line:hover:before {
border-left: 3px solid #4080D0;
}
diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json
index d04d8c15efa7f03ba3bb0d45580f9d4d24dc5938..1ba156c39424c17b0bd2c51cc5bf3a8c08540141 100644
--- a/extensions/markdown/package.json
+++ b/extensions/markdown/package.json
@@ -148,15 +148,20 @@
"default": 1.6,
"description": "%markdown.preview.lineHeight.desc%"
},
- "markdown.preview.experimentalSyncronizationEnabled": {
+ "markdown.preview.scrollPreviewWithEditorSelection": {
"type": "boolean",
"default": true,
- "description": "%markdown.preview.experimentalSyncronizationEnabled.desc%"
+ "description": "%markdown.preview.scrollPreviewWithEditorSelection.desc%"
},
- "markdown.preview.synchronizePreviewScrollingToEditor": {
+ "markdown.preview.markEditorSelection": {
"type": "boolean",
"default": true,
- "description": "%markdown.preview.synchronizePreviewScrollingToEditor.desc%"
+ "description": "%markdown.preview.markEditorSelection.desc%"
+ },
+ "markdown.preview.scrollEditorWithPreview": {
+ "type": "boolean",
+ "default": true,
+ "description": "%markdown.preview.scrollEditorWithPreview.desc%"
}
}
}
diff --git a/extensions/markdown/package.nls.json b/extensions/markdown/package.nls.json
index 3525054ac59723f3fd71cafe573baf29dcd2c33f..4af47ab2ce99db0fcf17aa00945d5b4f09279ce3 100644
--- a/extensions/markdown/package.nls.json
+++ b/extensions/markdown/package.nls.json
@@ -7,6 +7,7 @@
"markdown.preview.fontFamily.desc": "Controls the font family used in the markdown preview.",
"markdown.preview.fontSize.desc": "Controls the font size in pixels used in the markdown preview.",
"markdown.preview.lineHeight.desc": "Controls the line height used in the markdown preview. This number is relative to the font size.",
- "markdown.preview.experimentalSyncronizationEnabled.desc": "Enable experimental syncronization between the markdown preview and the editor",
- "markdown.preview.synchronizePreviewScrollingToEditor.desc": "When the preview is scrolled, update the view of the editor"
+ "markdown.preview.scrollPreviewWithEditorSelection.desc": "Scrolls the markdown preview to reveal the currently selected line from the editor.",
+ "markdown.preview.scrollEditorWithPreview.desc": "When the markdown preview is scrolled, update the view of the editor.",
+ "markdown.preview.markEditorSelection.desc": "Mark the current editor selection in the markdown preview."
}
\ No newline at end of file
diff --git a/extensions/markdown/src/extension.ts b/extensions/markdown/src/extension.ts
index b15a9a784c28ba232591710e2876f26a183064bc..b2bc76ef259bfa36bab5cd13adb0133c1d84feba 100644
--- a/extensions/markdown/src/extension.ts
+++ b/extensions/markdown/src/extension.ts
@@ -283,14 +283,14 @@ class MDDocumentContentProvider implements vscode.TextDocumentContentProvider {
${this.computeCustomStyleSheetIncludes(uri)}