mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Improve spell check edit tracking (#22577)
GitOrigin-RevId: 237e454b56fc18199bf64087dd3cfb93749b8468
This commit is contained in:
@@ -106,6 +106,7 @@ export class SpellChecker {
|
||||
_performSpellCheck(view: EditorView) {
|
||||
const wordsToCheck = this.getWordsToCheck(view)
|
||||
if (wordsToCheck.length === 0) {
|
||||
this.trackedChanges = ChangeSet.empty(0)
|
||||
return
|
||||
}
|
||||
const cache = view.state.field(cacheField)
|
||||
@@ -245,7 +246,7 @@ export class SpellChecker {
|
||||
|
||||
const { from, to } = view.viewport
|
||||
const changedLineNumbers = new Set<number>()
|
||||
if (this.trackedChanges.length > 0) {
|
||||
if (!this.trackedChanges.empty) {
|
||||
this.trackedChanges.iterChangedRanges((_fromA, _toA, fromB, toB) => {
|
||||
if (fromB <= to && toB >= from) {
|
||||
const fromLine = view.state.doc.lineAt(fromB).number
|
||||
|
||||
Reference in New Issue
Block a user