summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-05-26 13:34:59 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-05-26 13:39:54 +0200
commit0c134439043507aa533dcaf014def7189bf0aa21 (patch)
tree991e257a35614863d2929301f0e0d8261cc7d41a
parente1e1bfbf677043ed94a30a9a8c52be4ddf37716a (diff)
downloadqt-creator-0c134439043507aa533dcaf014def7189bf0aa21.tar.gz
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
-rw-r--r--src/shared/indenter/constants.cpp4
-rw-r--r--src/shared/indenter/indenter_impl.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/indenter/constants.cpp b/src/shared/indenter/constants.cpp
index 8373bf6374..c0e0301019 100644
--- a/src/shared/indenter/constants.cpp
+++ b/src/shared/indenter/constants.cpp
@@ -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);
diff --git a/src/shared/indenter/indenter_impl.h b/src/shared/indenter/indenter_impl.h
index 0571637302..bec48a2c13 100644
--- a/src/shared/indenter/indenter_impl.h
+++ b/src/shared/indenter/indenter_impl.h
@@ -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