forked from qt-creator/qt-creator
		
	Remove all the synthesized characters when matching curly braces
This commit is contained in:
		| @@ -75,7 +75,16 @@ static bool isCompleteCharLiteral(const BackwardsScanner &tk, int index) | ||||
|     return false; | ||||
| } | ||||
|  | ||||
| static bool shouldInsertMatchingText(const QChar &lookAhead) | ||||
| MatchingText::MatchingText() | ||||
| { } | ||||
|  | ||||
| bool MatchingText::shouldInsertMatchingText(const QTextCursor &tc) | ||||
| { | ||||
|     QTextDocument *doc = tc.document(); | ||||
|     return shouldInsertMatchingText(doc->characterAt(tc.selectionEnd())); | ||||
| } | ||||
|  | ||||
| bool MatchingText::shouldInsertMatchingText(const QChar &lookAhead) | ||||
| { | ||||
|     switch (lookAhead.unicode()) { | ||||
|     case '{': case '}': | ||||
| @@ -91,9 +100,6 @@ static bool shouldInsertMatchingText(const QChar &lookAhead) | ||||
|     } // switch | ||||
| } | ||||
|  | ||||
| MatchingText::MatchingText() | ||||
| { } | ||||
|  | ||||
| QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QString &textToProcess, | ||||
|                                           const QChar &la, int *skippedChars) const | ||||
| { | ||||
|   | ||||
| @@ -41,6 +41,9 @@ class CPLUSPLUS_EXPORT MatchingText | ||||
| public: | ||||
|     MatchingText(); | ||||
|  | ||||
|     static bool shouldInsertMatchingText(const QTextCursor &tc); | ||||
|     static bool shouldInsertMatchingText(const QChar &lookAhead); | ||||
|  | ||||
|     QString insertMatchingBrace(const QTextCursor &tc, const QString &text, | ||||
|                                 const QChar &la, int *skippedChars) const; | ||||
|     QString insertParagraphSeparator(const QTextCursor &tc) const; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user