Skip to content

Commit

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

export default class NinjaCursorPlugin extends Plugin {
Expand All @@ -15,7 +15,7 @@ export default class NinjaCursorPlugin extends Plugin {
))
))?.contentContainerEl?.parentElement;

const selection = window.getSelection();
const selection = activeWindow.getSelection();
if (!parentElement || !selection || !selection.focusNode) {
return;
}
Expand Down

0 comments on commit 625108c

Please sign in to comment.