Fix user defined auto-insert not working issue

Fix #3171, fix #8063, fix #12547, fix #14831, close #15005
This commit is contained in:
mpheath 2024-04-16 12:06:35 +10:00 committed by Don Ho
parent 914869936b
commit 8672d95ca4
3 changed files with 4 additions and 5 deletions

View File

@ -5849,7 +5849,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
close = closeVal;
if (open != -1 && close != -1)
_nppGUI._matchedPairConf._matchedPairsInit.push_back(pair<char, char>(char(open), char(close)));
_nppGUI._matchedPairConf._matchedPairs.push_back(pair<char, char>(char(open), char(close)));
}
}

View File

@ -731,7 +731,6 @@ public:
public:
std::vector<std::pair<char, char>> _matchedPairs;
std::vector<std::pair<char, char>> _matchedPairsInit; // used only on init
bool _doHtmlXmlTag = false;
bool _doParentheses = false;
bool _doBrackets = false;

View File

@ -4502,16 +4502,16 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIROPEN_EDIT3, EM_LIMITTEXT, 1, 0);
::SendDlgItemMessage(_hSelf, IDC_MACHEDPAIRCLOSE_EDIT3, EM_LIMITTEXT, 1, 0);
size_t nbMatchedPair = nppGUI._matchedPairConf._matchedPairsInit.size();
size_t nbMatchedPair = nppGUI._matchedPairConf._matchedPairs.size();
if (nbMatchedPair > 3)
nbMatchedPair = 3;
for (size_t i = 0; i < nbMatchedPair; ++i)
{
TCHAR openChar[2]{};
openChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].first;
openChar[0] = nppGUI._matchedPairConf._matchedPairs[i].first;
openChar[1] = '\0';
TCHAR closeChar[2]{};
closeChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].second;
closeChar[0] = nppGUI._matchedPairConf._matchedPairs[i].second;
closeChar[1] = '\0';
if (i == 0)