[DS-4896] add more ThreadingAssertions.assertWriteAccess() to NotebookIntervalPointerFactoryImpl

GitOrigin-RevId: e3b9cbedc3cd0146b8b77189b3e6e307b32d6913
This commit is contained in:
Igor Slobodskov
2023-12-05 17:36:10 +01:00
committed by intellij-monorepo-bot
parent 8ded962003
commit 3030aeadb3

View File

@@ -74,7 +74,7 @@ class NotebookIntervalPointerFactoryImpl(private val notebookCellLines: Notebook
get() = field?.takeIf { !project.isDisposed }
override fun create(interval: NotebookCellLines.Interval): NotebookIntervalPointer {
ThreadingAssertions.softAssertReadAccess()
ThreadingAssertions.assertReadAccess()
return pointers[interval.ordinal].also {
require(it.interval == interval)
}
@@ -90,12 +90,14 @@ class NotebookIntervalPointerFactoryImpl(private val notebookCellLines: Notebook
validUndoManager?.undoableActionPerformed(object : BasicUndoableAction(documentReference) {
override fun undo() {
ThreadingAssertions.assertWriteAccess()
val invertedChanges = invertChanges(eventChanges)
updatePointersByChanges(invertedChanges)
onUpdated(NotebookIntervalPointersEvent(invertedChanges, cellLinesEvent = null, EventSource.UNDO_ACTION))
}
override fun redo() {
ThreadingAssertions.assertWriteAccess()
updatePointersByChanges(eventChanges)
onUpdated(NotebookIntervalPointersEvent(eventChanges, cellLinesEvent = null, EventSource.REDO_ACTION))
}