From cac05bda38c75531dfa77ba12b9696b03483cf19 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Thu, 4 Aug 2016 13:44:58 +0300 Subject: [PATCH] local history: Made "ShowHistoryAction" operate on single selected file And not on the common parent of all the selected files (as before) --- .../integration/ui/actions/LocalHistoryAction.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryAction.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryAction.java index 08f399a15715..5c59007587ba 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryAction.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryAction.java @@ -21,11 +21,11 @@ import com.intellij.history.integration.IdeaGateway; import com.intellij.history.integration.LocalHistoryImpl; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.project.DumbAware; -import com.intellij.openapi.vfs.VfsUtilCore; +import com.intellij.openapi.vcs.VcsDataKeys; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.vcsUtil.VcsUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -71,14 +71,6 @@ public abstract class LocalHistoryAction extends AnAction implements DumbAware { @Nullable protected VirtualFile getFile(@NotNull AnActionEvent e) { - VirtualFile[] ff = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); - if (ff == null || ff.length == 0) return null; - - VirtualFile commonParent = ff[0]; - for (int i = 1; i < ff.length; i++) { - commonParent = VfsUtilCore.getCommonAncestor(commonParent, ff[i]); - if (commonParent == null) break; - } - return commonParent; + return VcsUtil.getIfSingle(e.getData(VcsDataKeys.VIRTUAL_FILE_STREAM)); } }