1
0
mirror of https://github.com/chylex/IntelliJ-AceJump.git synced 2025-05-10 16:34:05 +02:00

try @YannCebron's solution to , pt. II

This commit is contained in:
breandan 2023-07-26 22:08:35 -10:00
parent 2ffcc2c57a
commit 3c89cd07b9

View File

@ -35,11 +35,12 @@ sealed class AceAction: DumbAwareAction() {
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
final override fun update(action: AnActionEvent) {
action.presentation.isEnabled = (action.getData(EDITOR) ?: action.getData(LAST_ACTIVE_FILE_EDITOR)) != null
action.presentation.isEnabled =
(action.getData(EDITOR) ?: (action.getData(LAST_ACTIVE_FILE_EDITOR) as? TextEditor)?.editor) != null
}
final override fun actionPerformed(e: AnActionEvent) {
val editor = e.getData(EDITOR) ?: e.getData(LAST_ACTIVE_FILE_EDITOR) as? Editor ?: return
val editor = e.getData(EDITOR) ?: (e.getData(LAST_ACTIVE_FILE_EDITOR) as? TextEditor)?.editor ?: return
val project = e.project
if (project != null) {