Force to enable multi-select feature in Scintilla

This commit is contained in:
Don Ho 2023-10-30 15:40:49 +01:00
parent 4ba92b04ec
commit 89278e1dc7
12 changed files with 6 additions and 44 deletions

View File

@ -961,7 +961,6 @@ Translation note:
<Item id="6221" name="F"/>
<Item id="6222" name="S"/>
<Item id="6246" name="Make current level folding/unfolding commands toggleable"/>
<Item id="6225" name="Enable Multi-Editing (Ctrl+Mouse click/selection)"/>
<Item id="6227" name="Line Wrap"/>
<Item id="6228" name="Default"/>
<Item id="6229" name="Aligned"/>

View File

@ -961,7 +961,6 @@ Translation note:
<Item id="6221" name="F"/>
<Item id="6222" name="S"/>
<Item id="6246" name="Make current level folding/unfolding commands toggleable"/>
<Item id="6225" name="Enable Multi-Editing (Ctrl+Mouse click/selection)"/>
<Item id="6227" name="Line Wrap"/>
<Item id="6228" name="Default"/>
<Item id="6229" name="Aligned"/>

View File

@ -961,7 +961,6 @@ Translation note:
<Item id="6221" name="Vif"/><!-- Rapide -->
<Item id="6222" name="Zen"/><!-- Lent -->
<Item id="6246" name="Rendre les commandes de pliage/dépliage du niveau actuel commutables"/>
<Item id="6225" name="Activer Multi-édition (Ctrl+Clic/sélection)"/>
<Item id="6227" name="Ligne pliée"/>
<Item id="6228" name="Défaut"/>
<Item id="6229" name="Aligné"/>

View File

@ -933,7 +933,6 @@
<Item id="6221" name="快"/>
<Item id="6222" name="慢"/>
<Item id="6246" name="使折疊/展開當前層級命令可切換"/>
<Item id="6225" name="啟用多個位置同時編輯Ctrl + 滑鼠點擊/選取)"/>
<Item id="6227" name="換行設定"/>
<Item id="6228" name="預設"/>
<Item id="6229" name="對齊"/>

View File

@ -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);

View File

@ -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();

View File

@ -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);
}
// <GUIConfig name="ScintillaGlobalSettings" enableMultiSelection="no" />
{
TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();
GUIConfigElement->SetAttribute(TEXT("name"), TEXT("ScintillaGlobalSettings"));
GUIConfigElement->SetAttribute(TEXT("enableMultiSelection"), _nppGUI._enableMultiSelection ? TEXT("yes") : TEXT("no"));
}
// <GUIConfig name="openSaveDir" value="0" defaultDirPath="" />
{
TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement();

View File

@ -870,7 +870,6 @@ struct NppGUI final
bool _doesExistUpdater = false;
int _caretBlinkRate = 600;
int _caretWidth = 1;
bool _enableMultiSelection = false;
bool _shortTitlebar = false;

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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)