Take the selected end as look ahead

Cause that's the relevant context.
This commit is contained in:
Thorbjørn Lindeijer
2009-09-17 13:36:13 +02:00
parent 0fed004ad4
commit b5dbcee370

View File

@@ -1277,7 +1277,7 @@ QString CPPEditor::autoComplete(QTextCursor &cursor, const QString &text) const
return QString(); return QString();
QString autoText; QString autoText;
QChar lookAhead = characterAt(cursor.position()); QChar lookAhead = characterAt(cursor.selectionEnd());
if (lookAhead.isSpace() // Only auto-insert when the text right of the cursor seems unrelated if (lookAhead.isSpace() // Only auto-insert when the text right of the cursor seems unrelated
|| lookAhead == QLatin1Char('{') || lookAhead == QLatin1Char('{')
|| lookAhead == QLatin1Char('}') || lookAhead == QLatin1Char('}')