From 820ce7170a5eb3c5fc38e1cf1081c1c345c9f689 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Mon, 6 Jul 2015 13:54:58 +0300 Subject: [PATCH] Reformat Dialog: persist reformat only VCS changed lines checkbox state only if checkbox is enabled. Previously, if you show reformat dialog on file with no changes, checkbox will be disabled and will be selected "Whole File" scope option, and used it later on reformat. --- .../com/intellij/codeInsight/actions/LayoutCodeDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java index cd0a9c0890f2..511d9ed437b2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java @@ -151,7 +151,7 @@ public class LayoutCodeDialog extends DialogWrapper { myLastRunOptions.saveRearrangeState(myFile.getLanguage(), myRunOptions.isRearrangeCode()); } - if (!mySelectedTextRadioButton.isSelected()) { + if (!mySelectedTextRadioButton.isSelected() && myOnlyVCSChangedTextRb.isEnabled()) { myLastRunOptions.saveProcessVcsChangedTextState(myOnlyVCSChangedTextRb.isSelected()); } } @@ -201,8 +201,8 @@ public class LayoutCodeDialog extends DialogWrapper { @Override protected void doOKAction() { - super.doOKAction(); saveCurrentConfiguration(); + super.doOKAction(); } public LayoutCodeOptions getRunOptions() {