mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-72101: Do scrolling inside WriteAction as long as some components require it
GitOrigin-RevId: afb93cc8148154e9d9163ce5a9d71af41cecedaa
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bbd98aeb95
commit
5d07ddb9b3
+2
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user