diff --git a/src/components/arrowLigaturesExtension.ts b/src/components/arrowLigaturesExtension.ts index 83169ef4..f7aec33f 100644 --- a/src/components/arrowLigaturesExtension.ts +++ b/src/components/arrowLigaturesExtension.ts @@ -3,7 +3,7 @@ import { resolveArrowLigatureInput } from '../utils/arrowLigatures' const PREFIX_CONTEXT_LENGTH = 2 -function isInsertedCharacter(event: InputEvent) { +function isInsertedCharacter(event: InputEvent): event is InputEvent & { data: string } { return event.inputType === 'insertText' && typeof event.data === 'string' } diff --git a/src/hooks/useCodeMirror.ts b/src/hooks/useCodeMirror.ts index fdc78881..83ec58b0 100644 --- a/src/hooks/useCodeMirror.ts +++ b/src/hooks/useCodeMirror.ts @@ -78,7 +78,7 @@ function buildSaveKeymap(callbacks: { current: CodeMirrorCallbacks }) { function buildArrowLigaturesExtension() { let literalAsciiCursor: number | null = null - return EditorView.inputHandler.of((view, from, to, text) => { + return EditorView.inputHandler.of((view, from, _to, text) => { const beforeText = view.state.doc.sliceString(Math.max(0, from - 2), from) const resolution = resolveArrowLigatureInput({ beforeText,