From 75aa31cc16f9cfa8610cd26affc374f7cc4646f4 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 5 Nov 2024 10:57:23 +0100 Subject: [PATCH] Add a type declaration --- src/commands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index b356f7a..db152cd 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -1,5 +1,5 @@ import {EditorState, StateCommand, EditorSelection, SelectionRange, - ChangeSpec, Transaction, CharCategory, + StateEffect, ChangeSpec, Transaction, CharCategory, findClusterBreak, Text, Line, countColumn} from "@codemirror/state" import {EditorView, Command, Direction, KeyBinding} from "@codemirror/view" import {syntaxTree, IndentContext, getIndentUnit, indentUnit, indentString, @@ -218,7 +218,7 @@ function cursorByPage(view: EditorView, forward: boolean) { : rangeEnd(range, forward) }) if (selection.eq(state.selection)) return false - let effect + let effect: StateEffect | undefined if (page.selfScroll) { let startPos = view.coordsAtPos(state.selection.main.head) let scrollRect = view.scrollDOM.getBoundingClientRect()