diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 3d553ea4acc..8659650f988 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 8af95a69825..5e801ad2675 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(document()->documentLayout()); QTC_ASSERT(documentLayout, return);