diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 3c628379..150703e5 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -906,15 +906,26 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) case IDC_CHECK_FILEAUTODETECTION: { bool isChecked = isCheckedOrNot(IDC_CHECK_FILEAUTODETECTION); - if (!isChecked) - { - ::SendDlgItemMessage(_hSelf, IDC_CHECK_UPDATESILENTLY, BM_SETCHECK, BST_UNCHECKED, 0); - ::SendDlgItemMessage(_hSelf, IDC_CHECK_UPDATEGOTOEOF, BM_SETCHECK, BST_UNCHECKED, 0); - } ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATESILENTLY), isChecked); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATEGOTOEOF), isChecked); - nppGUI._fileAutoDetection = isChecked?cdAutoUpdate:cdDisabled; + bool isSilent = isCheckedOrNot(IDC_CHECK_UPDATESILENTLY); + bool isGo2End = isCheckedOrNot(IDC_CHECK_UPDATEGOTOEOF); + + ChangeDetect cd; + + if (!isChecked) + cd = cdDisabled; + else if (!isSilent && !isGo2End) + cd = cdEnabled; + else if (!isSilent && isGo2End) + cd = cdGo2end; + else if (isSilent && !isGo2End) + cd = cdAutoUpdate; + else //(isSilent && isGo2End) + cd = cdAutoUpdateGo2end; + + nppGUI._fileAutoDetection = cd; } return TRUE;