Created
October 29, 2024 16:15
-
-
Save dkandalov/3c3984ac39b51883920f019ff91f1351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("UnstableApiUsage") | |
import com.intellij.openapi.fileEditor.FileEditorManager | |
import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl | |
import liveplugin.registerAction | |
// Action to remove panel at the top of the editor, e.g. "Kotlin script is in beta" panel. | |
registerAction("Remove Top Editor Component", "ctrl meta H") { event -> | |
val project = event.project ?: return@registerAction | |
val editorManager = FileEditorManager.getInstance(project) as FileEditorManagerImpl | |
val editor = editorManager.selectedEditor ?: return@registerAction | |
editorManager.getTopComponents(editor).forEach { | |
editorManager.removeTopComponent(editor, it) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment