Commit fa18c39f authored by kirill.skrygan's avatar kirill.skrygan Committed by intellij-monorepo-bot
Browse files

expose api to close and open diff preview in editor

GitOrigin-RevId: ee0ddacc67d863e66c045abfc35d346c8fa8281e
parent 6282b446
Showing with 27 additions and 0 deletions
+27 -0
......@@ -252,6 +252,33 @@ public class ChangesViewManager implements ChangesViewEx,
return myToolWindowPanel.isAllowExcludeFromCommit();
}
public void closeEditorPreview() {
if (myToolWindowPanel == null) {
return;
}
ChangesViewPreview diffPreview = myToolWindowPanel.myDiffPreview;
if (diffPreview instanceof EditorTabPreview) {
PreviewDiffVirtualFile vcsContentFile = ((EditorTabPreview) diffPreview).getVcsContentFile();
FileEditorManager.getInstance(myProject).closeFile(vcsContentFile);
}
}
public void openEditorPreview() {
if (myToolWindowPanel == null) {
return;
}
ChangesViewPreview diffPreview = myToolWindowPanel.myDiffPreview;
if (diffPreview instanceof EditorTabPreview) {
EditorTabPreview editorTabPreview = (EditorTabPreview) diffPreview;
PreviewDiffVirtualFile vcsContentFile = editorTabPreview.getVcsContentFile();
if (editorTabPreview.getCurrentName() != null) {
FileEditorManager.getInstance(myProject).openFile(vcsContentFile, true, true);
}
}
}
public static class ChangesViewToolWindowPanel extends SimpleToolWindowPanel implements Disposable {
@NotNull private static final RegistryValue isToolbarHorizontalSetting = Registry.get("vcs.local.changes.toolbar.horizontal");
@NotNull private static final RegistryValue isCommitSplitHorizontal =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment