From 47f541690fb59365ea84a11897402633f71e1a64 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Fri, 12 May 2023 10:42:53 +0200 Subject: [PATCH] [cm6] fix spell check issue, use new document range (#13035) GitOrigin-RevId: 01b642dc867705c5de828fce439f424d7816d175 --- .../source-editor/extensions/spelling/misspelled-words.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/extensions/spelling/misspelled-words.ts b/services/web/frontend/js/features/source-editor/extensions/spelling/misspelled-words.ts index b6b89cb9dc..91b732ceb9 100644 --- a/services/web/frontend/js/features/source-editor/extensions/spelling/misspelled-words.ts +++ b/services/web/frontend/js/features/source-editor/extensions/spelling/misspelled-words.ts @@ -55,12 +55,12 @@ const removeMarksUnderEdit = ( marks: DecorationSet, transaction: Transaction ) => { - transaction.changes.iterChanges((fromA, toA) => { + transaction.changes.iterChanges((fromA, toA, fromB, toB) => { marks = marks.update({ // Filter out marks that overlap the change span filter: (from, to, mark) => { - const changeStartWithinMark = from <= fromA && to >= fromA - const changeEndWithinMark = from <= toA && to >= toA + const changeStartWithinMark = from <= fromB && to >= fromB + const changeEndWithinMark = from <= toB && to >= toB const markHasBeenEdited = changeStartWithinMark || changeEndWithinMark return !markHasBeenEdited },