Skip to content

Commit

Permalink
try @YannCebron's solution to acejump#415
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Jul 27, 2023
1 parent 56b1dfa commit 2ffcc2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import org.jetbrains.changelog.date

plugins {
idea apply true
kotlin("jvm") version "1.9.0-Beta"
id("org.jetbrains.intellij") version "1.14.1"
id("org.jetbrains.changelog") version "2.1.0"
kotlin("jvm") version "1.9.0"
id("org.jetbrains.intellij") version "1.15.0"
id("org.jetbrains.changelog") version "2.1.2"
id("com.github.ben-manes.versions") version "0.47.0"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
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
zipStorePath=wrapper/dists
6 changes: 4 additions & 2 deletions src/main/kotlin/org/acejump/action/AceAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package org.acejump.action
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
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.TextEditor
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
Expand Down Expand Up @@ -33,11 +35,11 @@ sealed class AceAction: DumbAwareAction() {
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT

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) {
val editor = e.getData(EDITOR) ?: return
val editor = e.getData(EDITOR) ?: e.getData(LAST_ACTIVE_FILE_EDITOR) as? Editor ?: return
val project = e.project

if (project != null) {
Expand Down

0 comments on commit 2ffcc2c

Please sign in to comment.