提交 e7730e36 编写于 作者: M Matt Bierner

Scroll sync for list items and quotes fixes #19151

上级 d1998fef
......@@ -29,6 +29,10 @@ body.showEditorSelection .code-line:hover:before {
height: 100%;
}
body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
left: -30px;
}
.vscode-light.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 0, 0, 0.15);
......
......@@ -16,8 +16,7 @@
"onLanguage:markdown",
"onCommand:markdown.showPreview",
"onCommand:markdown.showPreviewToSide",
"onCommand:markdown.showSource",
"onLanguage:markdown"
"onCommand:markdown.showSource"
],
"contributes": {
"languages": [
......
......@@ -50,6 +50,8 @@ export class MarkdownEngine {
this.addLineNumberRenderer(this.md, 'heading_open');
this.addLineNumberRenderer(this.md, 'image');
this.addLineNumberRenderer(this.md, 'code_block');
this.addLineNumberRenderer(this.md, 'blockquote_open');
this.addLineNumberRenderer(this.md, 'list_item_open');
this.addLinkNormalizer(this.md);
this.addLinkValidator(this.md);
......@@ -96,7 +98,7 @@ export class MarkdownEngine {
const original = md.renderer.rules[ruleName];
md.renderer.rules[ruleName] = (tokens: any, idx: number, options: any, env: any, self: any) => {
const token = tokens[idx];
if (token.level === 0 && token.map && token.map.length) {
if ((token.level === 0 || token.type === 'list_item_open' && token.level === 1) && token.map && token.map.length) {
token.attrSet('data-line', this.firstLine + token.map[0]);
token.attrJoin('class', 'code-line');
}
......@@ -113,7 +115,7 @@ export class MarkdownEngine {
md.normalizeLink = (link: string) => {
try {
let uri = vscode.Uri.parse(link);
if (!uri.scheme && !uri.fragment) {
if (!uri.scheme && uri.path && !uri.fragment) {
// Assume it must be a file
if (uri.path[0] === '/') {
uri = vscode.Uri.file(path.join(vscode.workspace.rootPath, uri.path));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册