mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: hide "History for Selection" from the project view context menu
The action makes sense only in the Editor context menu. IDEA-192384
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.vcs.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
@@ -105,6 +106,12 @@ public class SelectedBlockHistoryAction extends AbstractVcsAction {
|
||||
}
|
||||
|
||||
protected void update(@NotNull VcsContext context, @NotNull Presentation presentation) {
|
||||
Editor editor = context.getEditor();
|
||||
if (editor == null) {
|
||||
presentation.setEnabledAndVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
presentation.setEnabled(isEnabled(context));
|
||||
VcsSelection selection = VcsSelectionUtil.getSelection(context);
|
||||
if (selection != null) {
|
||||
|
||||
Reference in New Issue
Block a user