Commit 6894cd0b2ee5c788db407435f947d0128bc54c98

Fixed a potential issue with automatic brace matching

When encountering a line that hasn't been highlighted yet, we need to
abort the optimization for changing brace depth.

Done with Roberto Raggi and mae.
  
4848
4949void CppHighlighter::highlightBlock(const QString &text)
5050{
51 QTextCharFormat emptyFormat;
52
5351 const int previousState = previousBlockState();
5452 int state = 0, initialBraceDepth = 0;
5553 if (previousState != -1) {
223223 if (oldState == tokenize.state() && oldBraceDepth != braceDepth) {
224224 int delta = braceDepth - oldBraceDepth;
225225 QTextBlock block = currentBlock().next();
226 while (block.isValid()) {
226 while (block.isValid() && block.userState() != -1) {
227227 TextEditDocumentLayout::changeBraceDepth(block, delta);
228228 block = block.next();
229229 }