Don't emit cursorChange if we have a valid line

This commit is contained in:
Jonatan Heyman 2023-01-22 14:27:09 +01:00
parent 305ec124ac
commit 35f4bed7c1

View File

@ -285,7 +285,7 @@ const emitCursorChange = (editor) => ViewPlugin.fromClass(
if (update.selectionSet || langChange) {
const cursorLine = getBlockLineFromPos(update.state, update.state.selection.main.head)
const block = getActiveNoteBlock(update.state)
if (block) {
if (block && cursorLine) {
editor.element.dispatchEvent(new SelectionChangeEvent({
cursorLine,
language: block.language.name,