[NEW_FEATURE] New feature: auto-complete matched delimiters (in progress).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1110 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 11 years ago
parent 86fd35de42
commit eeebf23793

@ -4009,7 +4009,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
int open = -1;
int openVal = 0;
const TCHAR *openValStr = (subChildNode->ToElement())->Attribute(TEXT("open"), &openVal);
if (openValStr && (openVal >= 0 && openVal <= 255))
if (openValStr && (openVal >= 0 && openVal < 128))
{
open = openVal;
}
@ -4017,7 +4017,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
int close = -1;
int closeVal = 0;
const TCHAR *closeValStr = (subChildNode->ToElement())->Attribute(TEXT("close"), &closeVal);
if (closeValStr && (closeVal >= 0 && closeVal <= 255))
if (closeValStr && (closeVal >= 0 && closeVal <= 128))
{
close = closeVal;
}

@ -326,14 +326,14 @@ BEGIN
RTEXT "Open",IDC_MACHEDPAIROPEN_STATIC,307,103,25,8
LTEXT "Close",IDC_MACHEDPAIRCLOSE_STATIC,345,103,25,8
RTEXT "Matched pair 1:",IDC_MACHEDPAIR_STATIC1,248,117,70,8
EDITTEXT IDC_MACHEDPAIROPEN_EDIT1,320,115,10,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT1,348,115,10,14
EDITTEXT IDC_MACHEDPAIROPEN_EDIT1,320,115,14,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT1,348,115,14,14
RTEXT "Matched pair 2:",IDC_MACHEDPAIR_STATIC2,248,137,70,8
EDITTEXT IDC_MACHEDPAIROPEN_EDIT2,320,135,10,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT2,348,135,10,14
EDITTEXT IDC_MACHEDPAIROPEN_EDIT2,320,135,14,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT2,348,135,14,14
RTEXT "Matched pair 3:",IDC_MACHEDPAIR_STATIC3,248,157,70,8
EDITTEXT IDC_MACHEDPAIROPEN_EDIT3,320,155,10,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT3,348,155,10,14
EDITTEXT IDC_MACHEDPAIROPEN_EDIT3,320,155,14,14
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT3,348,155,14,14
END
IDD_PREFERENCE_MULTIINSTANCE_BOX DIALOGEX 0, 0, 455, 185
@ -355,10 +355,10 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Delimiter selection settings (Ctrl + Mouse double click)",IDC_DELIMITERSETTINGS_GB_STATIC,89,44,268,89,BS_CENTER
RTEXT "Open",IDD_STATIC_OPENDELIMITER,117,67,34,8
EDITTEXT IDC_EDIT_OPENDELIMITER,156,65,10,14
EDITTEXT IDC_EDIT_OPENDELIMITER,156,65,14,14
LTEXT "bla bla bla bla bla bla",IDD_STATIC_BLABLA,172,67,56,8
LTEXT "bla bla bla bla bla bla bla bla bla bla bla bla",IDD_STATIC_BLABLA2NDLINE,132,87,126,8
EDITTEXT IDC_EDIT_CLOSEDELIMITER,237,65,10,14
EDITTEXT IDC_EDIT_CLOSEDELIMITER,237,65,14,14
LTEXT "Close",IDD_STATIC_CLOSEDELIMITER,252,67,47,8
CONTROL "Allow on several lines",IDD_SEVERALLINEMODEON_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,109,160,10

@ -2313,10 +2313,10 @@ BOOL CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
nbMatchedPair = 3;
for (size_t i = 0; i < nbMatchedPair; ++i)
{
char openChar[2];
TCHAR openChar[2];
openChar[0] = nppGUI._matchedPairConf._matchedPairs[i].first;
openChar[1] = '\0';
char closeChar[2];
TCHAR closeChar[2];
closeChar[0] = nppGUI._matchedPairConf._matchedPairs[i].second;
closeChar[1] = '\0';
@ -2354,23 +2354,23 @@ BOOL CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
{
nppGUI._matchedPairConf._matchedPairs.clear();
char opener[2] = {'\0', '\0'};
char closer[2] = {'\0', '\0'};
TCHAR opener[2] = {'\0', '\0'};
TCHAR closer[2] = {'\0', '\0'};
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIROPEN_EDIT1, WM_GETTEXT, MAX_PATH, (LPARAM)opener);
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIRCLOSE_EDIT1, WM_GETTEXT, MAX_PATH, (LPARAM)closer);
if (opener[0] != '\0' && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(opener[0], closer[0]));
if (opener[0] < 0x80 && opener[0] != '\0' && closer[0] < 0x80 && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(static_cast<char>(opener[0]), static_cast<char>(closer[0])));
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIROPEN_EDIT2, WM_GETTEXT, MAX_PATH, (LPARAM)opener);
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIRCLOSE_EDIT2, WM_GETTEXT, MAX_PATH, (LPARAM)closer);
if (opener[0] != '\0' && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(opener[0], closer[0]));
if (opener[0] < 0x80 && opener[0] != '\0' && closer[0] < 0x80 && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(static_cast<char>(opener[0]), static_cast<char>(closer[0])));
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIROPEN_EDIT3, WM_GETTEXT, MAX_PATH, (LPARAM)opener);
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIRCLOSE_EDIT3, WM_GETTEXT, MAX_PATH, (LPARAM)closer);
if (opener[0] != '\0' && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(opener[0], closer[0]));
if (opener[0] < 0x80 && opener[0] != '\0' && closer[0] < 0x80 && closer[0] != '\0')
nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(static_cast<char>(opener[0]), static_cast<char>(closer[0])));
return TRUE;
}

Loading…
Cancel
Save