mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[DS-4896] use ThreadingAssertions.softAssertReadAccess() in NonIncrementalCellLines
GitOrigin-RevId: 2a507ec3376e192fa111fda559e1a1f5021f9740
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bac3d26b55
commit
b46292cd64
@@ -1,12 +1,12 @@
|
||||
package org.jetbrains.plugins.notebooks.visualization
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.editor.event.DocumentEvent
|
||||
import com.intellij.openapi.editor.event.DocumentListener
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.util.EventDispatcher
|
||||
import com.intellij.util.concurrency.ThreadingAssertions
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ class NonIncrementalCellLines private constructor(private val document: Document
|
||||
}
|
||||
|
||||
override fun intervalsIterator(startLine: Int): ListIterator<NotebookCellLines.Interval> {
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed()
|
||||
ThreadingAssertions.softAssertReadAccess()
|
||||
val ordinal = intervals.find { startLine <= it.lines.last }?.ordinal ?: intervals.size
|
||||
return intervals.listIterator(ordinal)
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class NonIncrementalCellLines private constructor(private val document: Document
|
||||
}
|
||||
|
||||
override fun documentChanged(event: DocumentEvent) {
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed()
|
||||
ThreadingAssertions.assertWriteAccess()
|
||||
val oldIntervals = intervals
|
||||
intervals = intervalsGenerator.makeIntervals(document)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user