PY-72101: Do scrolling inside WriteAction as long as some components require it

GitOrigin-RevId: afb93cc8148154e9d9163ce5a9d71af41cecedaa
This commit is contained in:
Ilya Muradyan
2024-04-19 14:04:33 +00:00
committed by intellij-monorepo-bot
parent bbd98aeb95
commit 5d07ddb9b3
@@ -1,6 +1,6 @@
package org.jetbrains.plugins.notebooks.visualization.ui
import com.intellij.openapi.application.ReadAction
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.editor.ex.util.EditorScrollingPositionKeeper
@@ -135,7 +135,7 @@ fun decorateTextEditor(textEditor: TextEditor): TextEditor {
}
internal fun keepScrollingPositionWhile(editor: Editor, task: Runnable) {
ReadAction.run<Nothing> {
WriteAction.run<Nothing> {
EditorScrollingPositionKeeper(editor).use { keeper ->
keeper.savePosition()
task.run()