diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 0a822603..f530082d 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -7374,8 +7374,10 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa _mainEditView.execute(SCI_SETZOOM, svp1._zoom); _subEditView.execute(SCI_SETZOOM, svp2._zoom); - _mainEditView.execute(SCI_SETMULTIPLESELECTION, true); - _subEditView.execute(SCI_SETMULTIPLESELECTION, true); + //_mainEditView.execute(SCI_SETMULTIPLESELECTION, true); + //_subEditView.execute(SCI_SETMULTIPLESELECTION, true); + ::SendMessage(hwnd, NPPM_INTERNAL_SETMULTISELCTION, 0, 0); + _mainEditView.execute(SCI_SETADDITIONALSELECTIONTYPING, true); _subEditView.execute(SCI_SETADDITIONALSELECTIONTYPING, true); @@ -8732,6 +8734,14 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa return TRUE; } + case NPPM_INTERNAL_SETMULTISELCTION : + { + NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI(); + _mainEditView.execute(SCI_SETMULTIPLESELECTION, nppGUI._enableMultiSelection); + _subEditView.execute(SCI_SETMULTIPLESELECTION, nppGUI._enableMultiSelection); + return TRUE; + } + case NPPM_INTERNAL_SETCARETBLINKRATE : { NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI(); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index e2859256..6e84f521 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -2914,6 +2914,13 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._caretBlinkRate = i; } + else if (!lstrcmp(nm, TEXT("ScintillaGlobalSettings"))) + { + val = element->Attribute(TEXT("enableMultiSelection")); + if (val && lstrcmp(val, TEXT("yes")) == 0) + _nppGUI._enableMultiSelection = true; + } + else if (!lstrcmp(nm, TEXT("AppPosition"))) { RECT oldRect = _nppGUI._appPos; @@ -3600,6 +3607,7 @@ bool NppParameters::writeGUIParams() bool smartHighLightExist = false; bool tagsMatchHighLightExist = false; bool caretExist = false; + bool ScintillaGlobalSettingsExist = false; bool openSaveDirExist = false; bool titleBarExist = false; bool stylerThemeExist = false; @@ -3709,6 +3717,11 @@ bool NppParameters::writeGUIParams() element->SetAttribute(TEXT("width"), _nppGUI._caretWidth); element->SetAttribute(TEXT("blinkRate"), _nppGUI._caretBlinkRate); } + else if (!lstrcmp(nm, TEXT("ScintillaGlobalSettings"))) + { + ScintillaGlobalSettingsExist = true; + element->SetAttribute(TEXT("enableMultiSelection"), _nppGUI._enableMultiSelection?TEXT("yes"):TEXT("no")); + } else if (!lstrcmp(nm, TEXT("Auto-detection"))) { autoDetectionExist = true; @@ -4117,6 +4130,13 @@ bool NppParameters::writeGUIParams() GUIConfigElement->SetAttribute(TEXT("blinkRate"), _nppGUI._caretBlinkRate); } + if (!ScintillaGlobalSettingsExist) + { + TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); + GUIConfigElement->SetAttribute(TEXT("name"), TEXT("ScintillaGlobalSettings")); + GUIConfigElement->SetAttribute(TEXT("enableMultiSelection"), _nppGUI._enableMultiSelection?TEXT("yes"):TEXT("no")); + } + if (!openSaveDirExist) { TiXmlElement *GUIConfigElement = (GUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index a4979019..a4d86983 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -655,7 +655,7 @@ struct NppGUI _isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false), _backupDir(TEXT("")),\ _doTaskList(true), _maitainIndent(true), _openSaveDir(dir_followCurrent), _styleMRU(true), _styleURL(0),\ _autocStatus(autoc_none), _autocFromLen(1), _funcParams(false), _definedSessionExt(TEXT("")),\ - _doesExistUpdater(false), _caretBlinkRate(250), _caretWidth(1), _shortTitlebar(false), _themeName(TEXT("")), _isLangMenuCompact(false) { + _doesExistUpdater(false), _caretBlinkRate(250), _caretWidth(1), _enableMultiSelection(false), _shortTitlebar(false), _themeName(TEXT("")), _isLangMenuCompact(false) { _appPos.left = 0; _appPos.top = 0; _appPos.right = 700; @@ -738,6 +738,7 @@ struct NppGUI bool _doesExistUpdater; int _caretBlinkRate; int _caretWidth; + bool _enableMultiSelection; bool _shortTitlebar; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 77b5d8e9..ce04b3eb 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -386,6 +386,7 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::SendMessage(::GetDlgItem(_hSelf, IDC_WIDTH_COMBO), CB_SETCURSEL, nppGUI._caretWidth, 0); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_SETCHECK, nppGUI._enableMultiSelection, 0); ::SendMessage(::GetDlgItem(_hSelf, IDC_CARETBLINKRATE_SLIDER),TBM_SETRANGEMIN, TRUE, BLINKRATE_FASTEST); ::SendMessage(::GetDlgItem(_hSelf, IDC_CARETBLINKRATE_SLIDER),TBM_SETRANGEMAX, TRUE, BLINKRATE_SLOWEST); @@ -407,7 +408,6 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) case WM_HSCROLL: { - NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI(); int blinkRate = (int)::SendMessage(::GetDlgItem(_hSelf, IDC_CARETBLINKRATE_SLIDER),TBM_GETPOS, 0, 0); if (blinkRate == BLINKRATE_SLOWEST) blinkRate = 0; @@ -440,7 +440,11 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_CURLINE_HILITING, iView); return TRUE; - + case IDC_CHECK_MULTISELECTION : + nppGUI._enableMultiSelection = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_GETCHECK, 0, 0)); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETMULTISELCTION, 0, 0); + return TRUE; + case IDC_RADIO_SIMPLE: svp._folderStyle = FOLDER_STYLE_SIMPLE; ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FOLDERMAGIN_SIMPLE, iView); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index c5b89cae..97b6e28b 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -78,6 +78,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define IDC_CARETBLINKRATE_F_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 21) #define IDC_CARETBLINKRATE_S_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 22) #define IDC_CHECK_DOCCHANGESTATEMARGE (IDD_PREFERENCE_MARGEIN_BOX + 23) + #define IDC_CHECK_MULTISELECTION (IDD_PREFERENCE_MARGEIN_BOX + 24) #define IDD_PREFERENCE_SETTING_BOX 6300 //(IDD_PREFERENCE_BOX + 300) #define IDC_TABSETTING_GB_STATIC (IDD_PREFERENCE_SETTING_BOX + 1) diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index fc7be044..9f643557 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -316,6 +316,7 @@ #define NPPM_INTERNAL_FOCUS_ON_FOUND_RESULTS (NOTEPADPLUS_USER_INTERNAL + 30) #define NPPM_INTERNAL_RELOADSTYLERS (NOTEPADPLUS_USER_INTERNAL + 31) #define NPPM_INTERNAL_DOCORDERCHANGED (NOTEPADPLUS_USER_INTERNAL + 32) + #define NPPM_INTERNAL_SETMULTISELCTION (NOTEPADPLUS_USER_INTERNAL + 33) //wParam: 0 //lParam: document new index