mirror of
https://github.com/chylex/IntelliJ-AceJump.git
synced 2025-05-28 09:34:05 +02:00
try @YannCebron's solution to #415
This commit is contained in:
parent
56b1dfa9a9
commit
2ffcc2c57a
@ -3,9 +3,9 @@ import org.jetbrains.changelog.date
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
idea apply true
|
idea apply true
|
||||||
kotlin("jvm") version "1.9.0-Beta"
|
kotlin("jvm") version "1.9.0"
|
||||||
id("org.jetbrains.intellij") version "1.14.1"
|
id("org.jetbrains.intellij") version "1.15.0"
|
||||||
id("org.jetbrains.changelog") version "2.1.0"
|
id("org.jetbrains.changelog") version "2.1.2"
|
||||||
id("com.github.ben-manes.versions") version "0.47.0"
|
id("com.github.ben-manes.versions") version "0.47.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-rc-2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -3,6 +3,8 @@ package org.acejump.action
|
|||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.CommonDataKeys.EDITOR
|
import com.intellij.openapi.actionSystem.CommonDataKeys.EDITOR
|
||||||
|
import com.intellij.openapi.actionSystem.PlatformDataKeys.LAST_ACTIVE_FILE_EDITOR
|
||||||
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||||
import com.intellij.openapi.fileEditor.TextEditor
|
import com.intellij.openapi.fileEditor.TextEditor
|
||||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
||||||
@ -33,11 +35,11 @@ sealed class AceAction: DumbAwareAction() {
|
|||||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
||||||
|
|
||||||
final override fun update(action: AnActionEvent) {
|
final override fun update(action: AnActionEvent) {
|
||||||
action.presentation.isEnabled = action.getData(EDITOR) != null
|
action.presentation.isEnabled = (action.getData(EDITOR) ?: action.getData(LAST_ACTIVE_FILE_EDITOR)) != null
|
||||||
}
|
}
|
||||||
|
|
||||||
final override fun actionPerformed(e: AnActionEvent) {
|
final override fun actionPerformed(e: AnActionEvent) {
|
||||||
val editor = e.getData(EDITOR) ?: return
|
val editor = e.getData(EDITOR) ?: e.getData(LAST_ACTIVE_FILE_EDITOR) as? Editor ?: return
|
||||||
val project = e.project
|
val project = e.project
|
||||||
|
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user