Skip to content

Commit

Permalink
Fix MarkdownSubView API change
Browse files Browse the repository at this point in the history
  • Loading branch information
9r0x committed Oct 14, 2022
1 parent 625108c commit dd336b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin, Notice, MarkdownView } from "obsidian";
type Coordinates = { x: number; y: number; getScroll: () => number };
type MarkdownSubView = { contentContainerEl: HTMLElement };
type MarkdownSubView = { sizerEl: HTMLElement };

export default class NinjaCursorPlugin extends Plugin {
lastPos: Coordinates = { x: 0, y: 0, getScroll: () => 0 };
Expand All @@ -13,8 +13,7 @@ export default class NinjaCursorPlugin extends Plugin {
this.app?.workspace.getActiveViewOfType(MarkdownView)
?.currentMode
))
))?.contentContainerEl?.parentElement;

))?.sizerEl?.parentElement;
const selection = activeWindow.getSelection();
if (!parentElement || !selection || !selection.focusNode) {
return;
Expand All @@ -31,7 +30,6 @@ export default class NinjaCursorPlugin extends Plugin {
}

const cursorDOMRects = cursorRange.getClientRects();
//console.log(cursorDOMRects)
const cursorDomRect = cursorDOMRects.item(cursorDOMRects.length - 1);

if (!cursorDomRect) {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "obsidian-dashing-cursor",
"name": "Dashing cursor",
"version": "0.0.1",
"minAppVersion": "0.15.0",
"version": "0.0.2",
"minAppVersion": "1.0.0",
"description": "Enables dashing cursor that follows the page scroll",
"author": "Shukai Ni",
"authorUrl": "https://github.com/9r0x/obsidian-dashing-cursor",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-dashing-cursor",
"version": "0.0.1",
"version": "0.0.2",
"description": "Enables dashing cursor that follows the page scroll",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit dd336b5

Please sign in to comment.