From 8672d95ca4a451b6b7a975b4f05e4725579bc21f Mon Sep 17 00:00:00 2001 From: mpheath Date: Tue, 16 Apr 2024 12:06:35 +1000 Subject: [PATCH] Fix user defined auto-insert not working issue Fix #3171, fix #8063, fix #12547, fix #14831, close #15005 --- PowerEditor/src/Parameters.cpp | 2 +- PowerEditor/src/Parameters.h | 1 - PowerEditor/src/WinControls/Preference/preferenceDlg.cpp | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 06b691501..016f93a2a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -5849,7 +5849,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) close = closeVal; if (open != -1 && close != -1) - _nppGUI._matchedPairConf._matchedPairsInit.push_back(pair(char(open), char(close))); + _nppGUI._matchedPairConf._matchedPairs.push_back(pair(char(open), char(close))); } } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index df34aade8..89af827ab 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -731,7 +731,6 @@ public: public: std::vector> _matchedPairs; - std::vector> _matchedPairsInit; // used only on init bool _doHtmlXmlTag = false; bool _doParentheses = false; bool _doBrackets = false; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 3a59a8194..0b0d78318 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -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)