Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
laech committed Jul 7, 2024
1 parent ed00f3f commit 2261da0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ internal class Popup(action: ActionNode, e: AnActionEvent) {
e.project,
ActionPresentationStep(items) { value, modifiers -> onActionChosen(value, modifiers) },
)
items.forEach { it.registerShortcuts(popup.list) { item, e -> this.onActionChosen(item, e) } }
items.forEach { item ->
item.registerShortcuts(popup.list) { event -> onActionChosen(item, event) }
}
}

fun show(dataContext: DataContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data class ActionPresentation(
}
}

fun registerShortcuts(list: JList<*>, consumer: (ActionPresentation, ActionEvent) -> Unit) {
fun registerShortcuts(list: JList<*>, handler: (ActionEvent) -> Unit) {
if (keys.isEmpty()) {
return
}
Expand All @@ -65,7 +65,7 @@ data class ActionPresentation(
key,
object : AbstractAction() {
override fun actionPerformed(e: ActionEvent) {
consumer(this@ActionPresentation, e)
handler(e)
}
},
)
Expand Down

0 comments on commit 2261da0

Please sign in to comment.