diff-preview: add action for moving diff preview to new window
authorDmitry Zhuravlev <dmitry.zhuravlev@jetbrains.com>
Wed, 18 Nov 2020 10:11:12 +0000 (13:11 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 15 Dec 2020 15:45:14 +0000 (15:45 +0000)
GitOrigin-RevId: c0406d8bd2eabd5625ef86c34f0d6ff0ed059a46

platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/vcs-impl/resources/META-INF/VcsActions.xml
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/MoveDiffPreviewAction.kt

index f742af27fa96904f04139e39ef3f0f1dcc094e75..cb75ddfec3b0a7cd8ae648f3e56abbc26760b8fa 100644 (file)
@@ -1287,6 +1287,7 @@ action.Vcs.MoveChangedLinesToChangelist.description=Move changes in selected lin
 action.Vcs.Diff.ExcludeChangedLinesFromCommit.text=Include Lines into Commit
 action.Vcs.Diff.IncludeOnlyChangedLinesIntoCommit.text=Include Only These Lines into Commit
 action.Vcs.Diff.ShowDiffInEditorTab.text=Show Diff in Editor Tab
 action.Vcs.Diff.ExcludeChangedLinesFromCommit.text=Include Lines into Commit
 action.Vcs.Diff.IncludeOnlyChangedLinesIntoCommit.text=Include Only These Lines into Commit
 action.Vcs.Diff.ShowDiffInEditorTab.text=Show Diff in Editor Tab
+action.Vcs.Diff.ShowDiffInNewWindow.text=Show Diff in Separate Window
 action.Vcs.RollbackChangedLines.text=Rollback Lines
 action.Vcs.RollbackChangedLines.description=Rollback changes in selected lines
 action.openAssertEqualsDiff.text=View assertEquals Difference
 action.Vcs.RollbackChangedLines.text=Rollback Lines
 action.Vcs.RollbackChangedLines.description=Rollback changes in selected lines
 action.openAssertEqualsDiff.text=View assertEquals Difference
index b2f9dde58c35836d4966c5dd5f4d089f413ae6e4..5807c4b4b72de9b5ba950a586fa13e5b80ace89e 100644 (file)
     <action id="Vcs.Diff.ShowDiffInEditorTab" class="com.intellij.openapi.vcs.changes.actions.diff.MoveDiffPreviewToEditorAction">
       <add-to-group group-id="Diff.EditorGutterPopupMenu.EditorSettings" anchor="last"/>
     </action>
     <action id="Vcs.Diff.ShowDiffInEditorTab" class="com.intellij.openapi.vcs.changes.actions.diff.MoveDiffPreviewToEditorAction">
       <add-to-group group-id="Diff.EditorGutterPopupMenu.EditorSettings" anchor="last"/>
     </action>
+    <group>
+      <action id="Vcs.Diff.ShowDiffInNewWindow"
+              icon="AllIcons.Actions.MoveToWindow"
+              class="com.intellij.openapi.vcs.changes.actions.diff.MoveDiffPreviewToNewWindowAction">
+      </action>
+      <separator/>
+      <add-to-group group-id="EditorTabPopupMenu" anchor="before" relative-to-action="SplitVertically"/>
+    </group>
 
     <reference ref="Vcs.VcsClone">
       <add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
 
     <reference ref="Vcs.VcsClone">
       <add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
index 956d17f53aa814758cc864f690456ce70944dc81..7c3a93e8c9cf43967d2e629c645897afddb8c7c9 100644 (file)
@@ -35,3 +35,7 @@ internal abstract class MoveDiffPreviewAction(private val openInNewWindow: Boole
 internal class MoveDiffPreviewToEditorAction : MoveDiffPreviewAction(false) {
   override fun isEnabledAndVisible(project: Project): Boolean = EditorDiffPreviewFilesManager.getInstance(project).shouldOpenInNewWindow
 }
 internal class MoveDiffPreviewToEditorAction : MoveDiffPreviewAction(false) {
   override fun isEnabledAndVisible(project: Project): Boolean = EditorDiffPreviewFilesManager.getInstance(project).shouldOpenInNewWindow
 }
+
+internal class MoveDiffPreviewToNewWindowAction : MoveDiffPreviewAction(true) {
+  override fun isEnabledAndVisible(project: Project): Boolean = !EditorDiffPreviewFilesManager.getInstance(project).shouldOpenInNewWindow
+}