mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Smooth markdown scrolling
This commit is contained in:
@@ -47,7 +47,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const sourceLine = Math.floor(line);
|
||||
const text = editor.document.getText(new vscode.Range(sourceLine, 0, sourceLine + 1, 0));
|
||||
const fraction = line - Math.floor(line);
|
||||
const start = fraction * text.length;
|
||||
const start = Math.floor(fraction * text.length);
|
||||
editor.revealRange(
|
||||
new vscode.Range(sourceLine, start, sourceLine + 1, 0),
|
||||
vscode.TextEditorRevealType.AtTop);
|
||||
|
||||
@@ -131,11 +131,8 @@ export class MarkdownEngine {
|
||||
private addLinkValidator(md: any): void {
|
||||
const validateLink = md.validateLink;
|
||||
md.validateLink = (link: string) => {
|
||||
if (validateLink(link)) {
|
||||
return true;
|
||||
}
|
||||
// support file:// links
|
||||
return link.indexOf('file:') === 0;
|
||||
return validateLink(link) || link.indexOf('file:') === 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user