diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 3d553ea4acca7649ee4eeed3570ba51122cc69e2..8659650f988bc6751f9cc855a8dc3a861e121035 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -842,7 +842,8 @@ bool CPPEditor::isElectricCharacter(const QChar &ch) const
 {
     if (ch == QLatin1Char('{') ||
         ch == QLatin1Char('}') ||
-        ch == QLatin1Char('#')) {
+        ch == QLatin1Char('#') ||
+        ch == QLatin1Char(':')) {
         return true;
     }
     return false;
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 8af95a69825b369a3f8dcbe4fa40cf481cad0028..5e801ad26756d7050bafa27f1eeded96875c4d85 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -932,11 +932,7 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
             QTextCursor cursor = textCursor();
             const QString text = e->text();
             cursor.insertText(text);
-            const QString leftText = cursor.block().text().left(cursor.position() - 1 - cursor.block().position());
-            if (leftText.simplified().isEmpty()) {
-                const QChar typedChar = e->text().at(0);
-                indent(document(), cursor, typedChar);
-            }
+            indent(document(), cursor, QChar::Null);
 #if 0
             TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout());
             QTC_ASSERT(documentLayout, return);