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

Fixed C++ indenter for global scope operator

When starting a line with :, the indenter now no longer removes the
indentation. Usually you do this when you're typing the global scope
operator.

Reviewed-by: Roberto Raggi
parent e1e1bfbf
......@@ -47,9 +47,9 @@ Constants::Constants() :
m_inlineCComment(QLatin1String("/\\*.*\\*/")),
m_braceX(QLatin1String("^\\s*\\}\\s*(?:else|catch)\\b")),
m_iflikeKeyword(QLatin1String("\\b(?:catch|do|for|if|while|foreach)\\b")),
m_caseLabel(QLatin1String("\\s*(?:case\\b(?:[^:]|::)+"
m_caseLabel(QLatin1String("^\\s*(?:case\\b(?:[^:]|::)+"
"|(?:public|protected|private|signals|Q_SIGNALS|default)(?:\\s+slots|\\s+Q_SLOTS)?\\s*"
")?:.*"))
"):"))
{
m_literal.setMinimal(true);
m_inlineCComment.setMinimal(true);
......
......@@ -1076,7 +1076,7 @@ int Indenter<Iterator>::indentForBottomLine(const Iterator &current,
*/
indent -= ppIndentSize;
} else if ( okay(typedIn, colon) ) {
if ( m_constants.m_caseLabel.exactMatch(bottomLine) ) {
if ( m_constants.m_caseLabel.indexIn(bottomLine) != -1 ) {
/*
Move a case label (or the ':' in front of a
constructor initialization list) one level to the
......
Markdown is supported
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