From 89278e1dc70d0171e1868cff359c38bbd0b46e00 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 30 Oct 2023 15:40:49 +0100 Subject: [PATCH] Force to enable multi-select feature in Scintilla --- PowerEditor/installer/nativeLang/english.xml | 1 - .../nativeLang/english_customizable.xml | 1 - PowerEditor/installer/nativeLang/french.xml | 1 - .../nativeLang/taiwaneseMandarin.xml | 1 - PowerEditor/src/Notepad_plus.cpp | 3 ++- PowerEditor/src/NppBigSwitch.cpp | 8 -------- PowerEditor/src/Parameters.cpp | 19 ------------------- PowerEditor/src/Parameters.h | 1 - .../src/WinControls/Preference/preference.rc | 5 ++--- .../WinControls/Preference/preferenceDlg.cpp | 6 ------ .../WinControls/Preference/preference_rc.h | 2 +- PowerEditor/src/resource.h | 2 +- 12 files changed, 6 insertions(+), 44 deletions(-) diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index c620a9d17..4ccf5f916 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -961,7 +961,6 @@ Translation note: - diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index 3720dfc80..8ee9c0a53 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -961,7 +961,6 @@ Translation note: - diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index f897cd866..9dc9eb42d 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -961,7 +961,6 @@ Translation note: - diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index dda5469a3..4aae29876 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -933,7 +933,6 @@ - diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index bb18ba5eb..af4b6c3d8 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -337,7 +337,8 @@ LRESULT Notepad_plus::init(HWND hwnd) _mainEditView.execute(SCI_SETZOOM, svp._zoom); _subEditView.execute(SCI_SETZOOM, svp._zoom2); - ::SendMessage(hwnd, NPPM_INTERNAL_SETMULTISELCTION, 0, 0); + _mainEditView.execute(SCI_SETMULTIPLESELECTION, true); + _subEditView.execute(SCI_SETMULTIPLESELECTION, true); // Make backspace or delete work with multiple selections _mainEditView.execute(SCI_SETADDITIONALSELECTIONTYPING, true); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index f95b0d796..d7cd42bf7 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1903,14 +1903,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return TRUE; } - case NPPM_INTERNAL_SETMULTISELCTION: - { - const NppGUI & nppGUI = nppParam.getNppGUI(); - _mainEditView.execute(SCI_SETMULTIPLESELECTION, nppGUI._enableMultiSelection); - _subEditView.execute(SCI_SETMULTIPLESELECTION, nppGUI._enableMultiSelection); - return TRUE; - } - case NPPM_INTERNAL_SETCARETBLINKRATE: { const NppGUI & nppGUI = nppParam.getNppGUI(); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index b616e2ddf..5fcd786fa 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -5177,18 +5177,6 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._caretBlinkRate = i; } - else if (!lstrcmp(nm, TEXT("ScintillaGlobalSettings"))) - { - const TCHAR* val = element->Attribute(TEXT("enableMultiSelection")); - if (val) - { - if (lstrcmp(val, TEXT("yes")) == 0) - _nppGUI._enableMultiSelection = true; - else if (lstrcmp(val, TEXT("no")) == 0) - _nppGUI._enableMultiSelection = false; - } - } - else if (!lstrcmp(nm, TEXT("AppPosition"))) { RECT oldRect = _nppGUI._appPos; @@ -7230,13 +7218,6 @@ void NppParameters::createXmlTreeFromGUIParams() GUIConfigElement->SetAttribute(TEXT("blinkRate"), _nppGUI._caretBlinkRate); } - // - { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("ScintillaGlobalSettings")); - GUIConfigElement->SetAttribute(TEXT("enableMultiSelection"), _nppGUI._enableMultiSelection ? TEXT("yes") : TEXT("no")); - } - // { TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 004eeeb90..f30ccfa15 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -870,7 +870,6 @@ struct NppGUI final bool _doesExistUpdater = false; int _caretBlinkRate = 600; int _caretWidth = 1; - bool _enableMultiSelection = false; bool _shortTitlebar = false; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index fcbec6b06..ddc9686df 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -113,10 +113,9 @@ BEGIN CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,88,270,10 CONTROL "Enable virtual space",IDC_CHECK_VIRTUALSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,103,270,10 CONTROL "Make current level folding/unfolding commands toggleable",IDC_CHECK_FOLDINGTOGGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,118,270,10 - CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,133,270,10 + CONTROL "Keep selection when right-click outside of selection", IDC_CHECK_RIGHTCLICKKEEPSSELECTION, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 173, 133, 270, 10 CONTROL "Enable scrolling beyond last line",IDC_CHECK_SCROLLBEYONDLASTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,148,270,10 - CONTROL "Keep selection when right-click outside of selection",IDC_CHECK_RIGHTCLICKKEEPSSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,163,270,10 - CONTROL "Disable advanced scrolling feature due to touchpad issue",IDC_CHECK_DISABLEADVANCEDSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,178,270,10 + CONTROL "Disable advanced scrolling feature due to touchpad issue",IDC_CHECK_DISABLEADVANCEDSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,163,270,10 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 0e90403c5..6026fed45 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -872,7 +872,6 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM ::SendMessage(::GetDlgItem(_hSelf, IDC_WIDTH_COMBO), CB_SETCURSEL, nppGUI._caretWidth, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_FOLDINGTOGGLE, BM_SETCHECK, nppGUI._enableFoldCmdToggable, 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); @@ -1175,11 +1174,6 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM svp._disableAdvancedScrolling = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_DISABLEADVANCEDSCROLL, BM_GETCHECK, 0, 0)); 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_CHECK_FOLDINGTOGGLE: nppGUI._enableFoldCmdToggable = isCheckedOrNot(IDC_CHECK_FOLDINGTOGGLE); return TRUE; diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 0e04e3201..ef3a21da6 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -124,7 +124,7 @@ #define IDC_CARETBLINKRATE_S_STATIC (IDD_PREFERENCE_SUB_EDITING + 22) #define IDC_CHECK_CHANGHISTORYMARGE (IDD_PREFERENCE_SUB_EDITING + 23) #define IDC_DISTRACTIONFREE_SLIDER (IDD_PREFERENCE_SUB_EDITING + 24) - #define IDC_CHECK_MULTISELECTION (IDD_PREFERENCE_SUB_EDITING + 25) + //#define IDC_CHECK_MULTISELECTION (IDD_PREFERENCE_SUB_EDITING + 25) #define IDC_RADIO_FOLDMARGENONE (IDD_PREFERENCE_SUB_EDITING + 26) diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index 343c45ad4..54dc54bbf 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -611,7 +611,7 @@ #define NPPM_INTERNAL_SETTING_TAB_SIZE (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) + //#define NPPM_INTERNAL_SETMULTISELCTION (NOTEPADPLUS_USER_INTERNAL + 33) #define NPPM_INTERNAL_SCINTILLAFINDEROPENALL (NOTEPADPLUS_USER_INTERNAL + 34) #define NPPM_INTERNAL_RECENTFILELIST_UPDATE (NOTEPADPLUS_USER_INTERNAL + 35) #define NPPM_INTERNAL_RECENTFILELIST_SWITCH (NOTEPADPLUS_USER_INTERNAL + 36)