IJPL-846 create an editor window in bulk mode - no need to repaint (as it will be called on editor creation)

GitOrigin-RevId: 5e9a77846b04626a2da2db9878f9b9e81d4ffc4b
This commit is contained in:
Vladimir Krivosheev
2024-03-25 10:17:41 +00:00
committed by intellij-monorepo-bot
parent 76578a159c
commit 92f91e1d47
2 changed files with 15 additions and 8 deletions
@@ -680,7 +680,7 @@ private class EditorTabs(
override fun revalidateAndRepaint(layoutNow: Boolean) {
// called from super constructor
@Suppress("SENSELESS_COMPARISON")
if (window == null || !window.owner.isInsideChange) {
if (window != null && !window.owner.isInsideChange) {
super.revalidateAndRepaint(layoutNow)
}
}
@@ -905,14 +905,21 @@ private class UiBuilder(private val splitters: EditorsSplitters) {
requestFocus: Boolean) {
coroutineScope {
val windowDeferred = async(Dispatchers.EDT) {
val editorWindow = EditorWindow(owner = splitters, splitters.coroutineScope.childScope(CoroutineName("EditorWindow")))
splitters.addWindow(editorWindow)
editorWindow.component.isFocusable = false
if (tabSizeLimit != 1) {
editorWindow.tabbedPane.component.putClientProperty(JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY, tabSizeLimit)
splitters.insideChange++
try {
val editorWindow = EditorWindow(owner = splitters, splitters.coroutineScope.childScope(CoroutineName("EditorWindow")))
splitters.addWindow(editorWindow)
editorWindow.component.isFocusable = false
if (tabSizeLimit != 1) {
editorWindow.tabbedPane.component.putClientProperty(JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY, tabSizeLimit)
}
addChild(editorWindow.component)
editorWindow
}
finally {
// do not call `validate` - will be called on editor `add` in any case
splitters.insideChange--
}
addChild(editorWindow.component)
editorWindow
}
val fileEditorManager = splitters.manager