From 1017264d211e4724ddd41b26f592b990bcc98da4 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 23 May 2023 23:19:08 +0300 Subject: [PATCH] CommandProcessor not required for "EditorChange" GitOrigin-RevId: f6baea5458a2933c2da0d9915e0c59b7834f5f66 --- .../fileEditor/impl/EditorTabbedContainer.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabbedContainer.kt b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabbedContainer.kt index 608f555959eb..3dc51af2ce5d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabbedContainer.kt +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabbedContainer.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. @file:Suppress("ReplacePutWithAssignment") package com.intellij.openapi.fileEditor.impl @@ -16,7 +16,6 @@ import com.intellij.openapi.actionSystem.* import com.intellij.openapi.actionSystem.impl.ActionButton import com.intellij.openapi.application.EDT import com.intellij.openapi.application.readAction -import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.editor.colors.EditorColorsManager import com.intellij.openapi.editor.markup.TextAttributes import com.intellij.openapi.fileEditor.FileEditorManager @@ -124,8 +123,7 @@ class EditorTabbedContainer internal constructor(private val window: EditorWindo val oldEditor = if (oldSelection == null) null else window.manager.getSelectedEditor((oldSelection.getObject() as VirtualFile)) oldEditor?.deselectNotify() val newFile = (newSelection ?: return).getObject() as VirtualFile - val newEditor = newFile.let { window.manager.getSelectedEditor(newFile) } - newEditor?.selectNotify() + window.manager.getSelectedEditor(newFile)?.selectNotify() if (GeneralSettings.getInstance().isSyncOnFrameActivation) { VfsUtil.markDirtyAndRefresh(true, false, false, newFile) } @@ -135,12 +133,8 @@ class EditorTabbedContainer internal constructor(private val window: EditorWindo if (window.isDisposed) { return@setSelectionChangeHandler ActionCallback.DONE } - val result = ActionCallback() - CommandProcessor.getInstance().executeCommand(project, { - (IdeDocumentHistory.getInstance(project) as IdeDocumentHistoryImpl).onSelectionChanged() - result.notify(doChangeSelection.run()) - }, "EditorChange", null) - result + IdeDocumentHistory.getInstance(project).onSelectionChanged() + doChangeSelection.run() } editorTabs.presentation.setRequestFocusOnLastFocusedComponent(true) editorTabs.component.addMouseListener(object : MouseAdapter() {