From 88a8889c1583ce5ce574a1c2867dfc983943ac9a Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 16 Dec 2014 17:59:28 +0000 Subject: [PATCH] [BUG_FIXED] Fix the bug that ] and } don't be skipped if "auto-insert ()" is disabled. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1309 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/ScitillaComponent/AutoCompletion.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index cb4a6167..df3d2b31 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -554,16 +554,27 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m case int(')') : case int(']') : case int('}') : - if (matchedPairConf._doParentheses && !_insertedMatchedChars.isEmpty()) + if (!_insertedMatchedChars.isEmpty()) { char startChar; if (character == int(')')) + { + if (!matchedPairConf._doParentheses) + return; startChar = '('; + } else if (character == int(']')) + { + if (!matchedPairConf._doBrackets) + return; startChar = '['; + } else // if (character == int('}')) + { + if (!matchedPairConf._doCurlyBrackets) + return; startChar = '{'; - + } int pos = _insertedMatchedChars.search(startChar, char(character), caretPos); if (pos != -1) {