mirror of
https://github.com/chylex/IntelliJ-AceJump.git
synced 2025-05-10 16:34:05 +02:00
try @YannCebron's solution to #415, pt. II
This commit is contained in:
parent
2ffcc2c57a
commit
3c89cd07b9
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user