Reduce vertical jump for other blocks

This commit is contained in:
Zef Hemel
2022-12-19 12:35:58 +01:00
parent d032672076
commit bb04f30470
6 changed files with 79 additions and 51 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ import { CollabState } from "./cm_plugins/collab.ts";
import { collabSyscalls } from "./syscalls/collab.ts";
import { vim } from "./deps.ts";
const frontMatterRegex = /^---\s*$(.*?)---\s*$/ms;
const frontMatterRegex = /^---\n(.*?)---\n/ms;
class PageState {
constructor(
@@ -317,7 +317,7 @@ export class Editor {
const match = frontMatterRegex.exec(pageText);
if (match) {
// Frontmatter found, put cursor after it
initialCursorPos = match[0].length + 1;
initialCursorPos = match[0].length;
}
// By default scroll to the top
this.editorView.scrollDOM.scrollTop = 0;