diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index cd957364a..223013f73 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3417,6 +3417,7 @@ void Notepad_plus::command(int id) case IDM_SETTING_AUTOCNBCHAR: { + const int NB_MIN_CHAR = 1; const int NB_MAX_CHAR = 9; ValueDlg valDlg; @@ -3431,6 +3432,9 @@ void Notepad_plus::command(int id) { if (size > NB_MAX_CHAR) size = NB_MAX_CHAR; + else if (size < NB_MIN_CHAR) + size = NB_MIN_CHAR; + nppGUI._autocFromLen = size; } break; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 5e5caa3ee..d77c91e73 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -220,4 +220,5 @@ BEGIN RTEXT "From",IDD_AUTOC_STATIC_FROM,208,114,47,8 CTEXT "1",IDD_AUTOC_STATIC_N,259,114,8,8 LTEXT "th characters",IDD_AUTOC_STATIC_CHAR,273,114,57,8 + LTEXT "Valid value : 1 - 9",IDD_AUTOC_STATIC_NOTE,238,124,93,8 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 5a7dc0720..9d1355b05 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1328,6 +1328,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_FROM), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_CHAR), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_NOTE), FALSE); } updateBackupGUI(); return TRUE; @@ -1403,6 +1404,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_FROM), isEnableAutoC); ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), isEnableAutoC); ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_CHAR), isEnableAutoC); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_NOTE), isEnableAutoC); return TRUE; } diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index d26dd1bea..e39b9400f 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -173,3 +173,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define IDD_AUTOC_STATIC_FROM (IDD_PREFERENCE_BACKUP_BOX + 11) #define IDD_AUTOC_STATIC_N (IDD_PREFERENCE_BACKUP_BOX + 12) #define IDD_AUTOC_STATIC_CHAR (IDD_PREFERENCE_BACKUP_BOX + 13) + #define IDD_AUTOC_STATIC_NOTE (IDD_PREFERENCE_BACKUP_BOX + 14)