forked from qt-creator/qt-creator
TextEditor: Make TabSettings accessible for AutoCompleters
Change-Id: I3591ad94ca98979c2d47585d33800a489d87eeda Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -117,11 +117,11 @@ QString CMakeAutoCompleter::insertMatchingQuote(const QTextCursor &cursor,
|
||||
return quote;
|
||||
}
|
||||
|
||||
int CMakeAutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, const TextEditor::TabSettings &tabSettings)
|
||||
int CMakeAutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
|
||||
{
|
||||
const QString line = cursor.block().text().trimmed();
|
||||
if (line.contains(QRegExp(QStringLiteral("^(endfunction|endmacro|endif|endforeach|endwhile)\\w*\\("))))
|
||||
tabSettings.indentLine(cursor.block(), tabSettings.indentationColumn(cursor.block().text()));
|
||||
tabSettings().indentLine(cursor.block(), tabSettings().indentationColumn(cursor.block().text()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
QChar lookAhead, bool skipChars, int *skippedChars) const override;
|
||||
QString insertMatchingQuote(const QTextCursor &cursor, const QString &text,
|
||||
QChar lookAhead, bool skipChars, int *skippedChars) const override;
|
||||
int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, const TextEditor::TabSettings &tabSettings) override;
|
||||
int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor) override;
|
||||
bool contextAllowsAutoBrackets(const QTextCursor &cursor, const QString &textToInsert) const override;
|
||||
bool contextAllowsAutoQuotes(const QTextCursor &cursor, const QString &textToInsert) const override;
|
||||
bool contextAllowsElectricCharacters(const QTextCursor &cursor) const override;
|
||||
|
||||
Reference in New Issue
Block a user