Pass the lookahead character to matching text.

This commit is contained in:
Roberto Raggi
2009-09-17 18:39:10 +02:00
parent 82b80b9e39
commit da4fcd22ef
3 changed files with 28 additions and 4 deletions

View File

@@ -1275,11 +1275,13 @@ QString CPPEditor::autoComplete(QTextCursor &cursor, const QString &text) const
if (!contextAllowsAutoParentheses(cursor))
return QString();
QChar lookAhead = characterAt(cursor.selectionEnd());
QString autoText;
int skippedChars = 0;
MatchingText matchingText;
autoText = matchingText.insertMatchingBrace(cursor, text, &skippedChars);
autoText = matchingText.insertMatchingBrace(cursor, text, lookAhead, &skippedChars);
if (skippedChars) {
const int pos = cursor.position();