Commit cb75dd05 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Prevent endless loop when no matching brace is found

Would show up when typing ")," where the closing brace doesn't have a
matching opening brace, for example.

Done with Roberto Raggi.
parent a0fa3832
......@@ -265,9 +265,14 @@ int ExpressionUnderCursor::startOfFunctionCall(const QTextCursor &cursor)
else if (
return startPosition + tk.position();
else if (
index = startOfMatchingBrace(tokens, index);
else if ( {
int matchingBrace = startOfMatchingBrace(tokens, index);
if (matchingBrace == index) // If no matching brace found
return -1;
index = matchingBrace;
} else
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment