Created
May 20, 2021 08:12
-
-
Save boonshift/2e241311c58e019b74b8f35d1ed28981 to your computer and use it in GitHub Desktop.
Pin some specific files via IntelliJ's IDE Scripting Console
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
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx | |
val b = bindings as Map<String, Any> | |
val IDE = b["IDE"] as com.intellij.ide.script.IDE | |
val editor = FileEditorManagerEx.getInstance(IDE.project) as FileEditorManagerEx | |
val filesToPin = editor.openFiles.filter { it.name.contains("Scratch") } | |
filesToPin.forEach { f -> editor.currentWindow.setFilePinned(f, true) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment