[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
This commit is contained in:
Don Ho 2014-12-16 17:59:28 +00:00
parent 1ebef477cc
commit 88a8889c15

View File

@ -554,16 +554,27 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
case int(')') : case int(')') :
case int(']') : case int(']') :
case int('}') : case int('}') :
if (matchedPairConf._doParentheses && !_insertedMatchedChars.isEmpty()) if (!_insertedMatchedChars.isEmpty())
{ {
char startChar; char startChar;
if (character == int(')')) if (character == int(')'))
{
if (!matchedPairConf._doParentheses)
return;
startChar = '('; startChar = '(';
}
else if (character == int(']')) else if (character == int(']'))
{
if (!matchedPairConf._doBrackets)
return;
startChar = '['; startChar = '[';
}
else // if (character == int('}')) else // if (character == int('}'))
{
if (!matchedPairConf._doCurlyBrackets)
return;
startChar = '{'; startChar = '{';
}
int pos = _insertedMatchedChars.search(startChar, char(character), caretPos); int pos = _insertedMatchedChars.search(startChar, char(character), caretPos);
if (pos != -1) if (pos != -1)
{ {