mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 19:41:33 +02:00
Merge pull request #19966 from overleaf/revert-19424-jdt-batch-spelling-line-tracker-updates
Revert "Line changes spread into array (avoiding max call stack)" GitOrigin-RevId: 5039d4182aeeb5d8c3aed13af45af177755a3823
This commit is contained in:
committed by
Copybot
parent
5065bb78ea
commit
b3d9ea5ad3
@@ -113,14 +113,18 @@ export class LineTracker {
|
||||
*/
|
||||
|
||||
const changes = new Array(insertedText.lines).fill(true)
|
||||
const index = startLine - 1 + lineShift
|
||||
try {
|
||||
this._lines.splice(startLine - 1 + lineShift, 1, ...changes)
|
||||
lineShift += changes.length - 1
|
||||
} catch (error) {
|
||||
if (error instanceof RangeError) {
|
||||
throw new OError(error.message).withInfo({
|
||||
changesSize: changes.length,
|
||||
})
|
||||
}
|
||||
|
||||
this._lines = [
|
||||
...this._lines.slice(0, index),
|
||||
...changes,
|
||||
...this._lines.slice(index + 1),
|
||||
]
|
||||
lineShift += changes.length - 1
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user