Commit 62705df6 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Moved indentation utility method from CPPEditor into BaseTextEditor.

Reviewed-by: Roberto Raggi
parent 85ff8c22
......@@ -1561,11 +1561,6 @@ bool CPPEditor::isInComment(const QTextCursor &cursor) const
return false;
}
void CPPEditor::indentInsertedText(const QTextCursor &tc)
{
indent(tc.document(), tc, QChar::Null);
}
// Indent a code line based on previous
template <class Iterator>
static void indentCPPBlock(const CPPEditor::TabSettings &ts,
......
......@@ -186,8 +186,6 @@ public:
~CPPEditor();
void unCommentSelection();
void indentInsertedText(const QTextCursor &tc);
unsigned editorRevision() const;
bool isOutdated() const;
SemanticInfo semanticInfo() const;
......
......@@ -3803,6 +3803,11 @@ bool BaseTextEditor::isElectricCharacter(const QChar &) const
return false;
}
void BaseTextEditor::indentInsertedText(const QTextCursor &tc)
{
indent(tc.document(), tc, QChar::Null);
}
void BaseTextEditor::countBracket(QChar open, QChar close, QChar c, int *errors, int *stillopen)
{
if (c == open)
......
......@@ -533,6 +533,9 @@ protected:
public:
// Returns true if key triggers an indent.
virtual bool isElectricCharacter(const QChar &ch) const;
void indentInsertedText(const QTextCursor &tc);
protected:
// Returns the text to complete at the cursor position, or an empty string
virtual QString autoComplete(QTextCursor &cursor, const QString &text) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment