void (@NotNull AnActionEvent e) { if (DiffUtil.isFromShortcut(e)) { // consume shortcut even if there are nothing to do - avoid calling some other action e.getPresentation().setEnabledAndVisible(true); return; } Editor editor = e.getData(CommonDataKeys.EDITOR); Side side = Side.fromValue(getEditors(), editor); if (side == null || !isVisible(side)) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setText(getText(side)); e.getPresentation().setIcon(getIcon(side)); e.getPresentation().setVisible(true); e.getPresentation().setEnabled(isSomeChangeSelected(side)); }